-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.dev.js
More file actions
48 lines (47 loc) · 1.38 KB
/
Copy pathwebpack.config.dev.js
File metadata and controls
48 lines (47 loc) · 1.38 KB
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
const path = require('path');
module.exports = {
entry: {
'rngparser': './src/rng-parser.ts',
'docspec': './src/docspec.ts',
},
module: {
rules: [{
test: /\.css$/,
use: ['style-loader', 'css-loader']
}, {
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader']
}, {
test: /\.tsx?$/,
exclude: /node_modules/,
loader: 'ts-loader',
}, {
test: /\.xsl|\.xml$/i,
use: 'raw-loader'
}],
},
output: {
filename: '[name].js',
// Path on disk for output file
path: path.resolve(__dirname, 'dist'),
// Path in webpack-dev-server for compiled files (has priority over disk files in case both exist)
publicPath: '/dist/',
clean: true, // clean previous outputs prior to compiling
library: '[name]lib',
},
resolve: {
extensions: ['.js', '.ts'], // enable autocompleting .ts and .js extensions when using import '...'
alias: {
// Enable importing source files by their absolute path by prefixing with "@/"
// Note: this also requires typescript to be able to find the imports (though it doesn't use them other than for type checking), see tsconfig.json
"@": path.join(__dirname, "src"),
}
},
externals: {
"@kcmertens/xonomy": "Xonomy"
},
devtool: "eval-source-map",
// enabling this breaks exporting to window through the library option above.
// See https://github.com/webpack/webpack/issues/11887
devServer:{injectClient: false},
};