-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.js
57 lines (55 loc) · 1.45 KB
/
webpack.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
const path = require('path')
const nodeExternals = require('webpack-node-externals')
const resolve = p => path.resolve(__dirname, '.', p)
module.exports = {
mode: 'development',
devtool: false,
target: 'node',
entry: {
index: resolve('./src/index.ts'),
build: resolve('./src/bin/build.ts'),
'custom-build': resolve('./src/bin/custom-build.ts'),
dev: resolve('./src/bin/dev.ts'),
'bootstrap-storybook': resolve('./src/bin/bootstrap-storybook.ts'),
'empty-module': resolve('./src/utils/empty-module.js')
},
output: {
path: resolve('./dist'),
filename: '[name].js',
libraryTarget: 'commonjs2'
},
resolve: {
extensions: ['.ts', '.js'],
alias: {
'src.config': resolve('./src/config'),
'src-utils-compiler$': resolve('./src/utils/compiler.webpack'),
'src-config-webpack.config.config$': resolve(
'./src/config/webpack.config.config'
),
'src-config-webpack.dll.config$': resolve(
'./src/config/webpack.dll.config'
),
'src-config-webpack.extensions.config$': resolve(
'./src/config/webpack.extensions.config'
),
src: resolve('./src'),
config: resolve('./config')
}
},
externals: [
nodeExternals({
// whitelist: /\.css$/
whitelist: [/\.css$/, /\?vue&type=style/]
})
],
module: {
rules: [
{
test: /\.tsx?$/,
exclude: /node_modules/,
use: ['ts-loader']
}
]
},
plugins: []
}