forked from microsoft/rushstack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
34 lines (32 loc) · 948 Bytes
/
webpack.config.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
'use strict';
const webpack = require('webpack');
const { PreserveDynamicRequireWebpackPlugin } = require('@rushstack/webpack-preserve-dynamic-require-plugin');
const PathConstants = require('./lib/PathConstants');
module.exports = () => {
return {
context: __dirname,
mode: 'development', // So the output isn't minified
devtool: 'source-map',
entry: {
[PathConstants.createLinksScriptFilename]: {
import: `${__dirname}/lib-esnext/scripts/create-links.js`,
filename: `[name]`
}
},
output: {
path: PathConstants.scriptsFolderPath,
filename: '[name].js',
chunkFilename: 'chunks/[name].js', // TODO: Don't allow any chunks to be created
library: {
type: 'commonjs2'
}
},
target: 'node',
plugins: [
new PreserveDynamicRequireWebpackPlugin(),
new webpack.ids.DeterministicModuleIdsPlugin({
maxLength: 6
})
]
};
};