You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.4 KiB
57 lines
1.4 KiB
var path = require('path');
|
|
var webpack = require('webpack');
|
|
|
|
|
|
|
|
module.exports = function (env) {
|
|
return [{
|
|
target: 'node',
|
|
entry: {
|
|
index: [
|
|
path.resolve(__dirname, 'src/index.ts')
|
|
]
|
|
},
|
|
output: {
|
|
library: 'example',
|
|
|
|
libraryTarget: 'commonjs2',
|
|
filename: 'index.js',
|
|
path: path.resolve(__dirname, 'bin'),
|
|
devtoolModuleFilenameTemplate: '../[resource-path]',
|
|
},
|
|
module: {
|
|
rules: [{
|
|
test: /\.ts$/,
|
|
use: [
|
|
'babel-loader',
|
|
'ts-loader',
|
|
],
|
|
}, {
|
|
test: /\.js$/,
|
|
use: ['babel-loader'],
|
|
resolve: {
|
|
fullySpecified: false,
|
|
},
|
|
}, {
|
|
test: /\.m?js/,
|
|
resolve: {
|
|
fullySpecified: false,
|
|
},
|
|
}, {
|
|
enforce: 'pre',
|
|
test: /\.[tj]s$/,
|
|
use: {
|
|
loader: 'source-map-loader',
|
|
options: {
|
|
}
|
|
},
|
|
}]
|
|
},
|
|
plugins: [],
|
|
resolve: {
|
|
extensions: ['.ts', '.js']
|
|
},
|
|
devtool: 'source-map'
|
|
},
|
|
|
|
]}
|
|
|