-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.test.config.js
37 lines (34 loc) · 1.02 KB
/
webpack.test.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
35
36
37
/**
* Learning Data Visualization With D3.js, Second Edition
*
* Ændrew Rininsland, <[email protected]>
*
* This is the Webpack configuration file. Webpack is used both as a task runner
* and also a module bundler. This is why we can use snazzy NodeJS-style `require`
* statements and also ES6 module definitions.
*/
const path = require('path');
module.exports = [
{
output: { // Transpiled and bundled output gets put in `build/bundle.js`.
path: path.resolve(__dirname, 'build'),
publicPath: '/assets/', // But it gets served as "assets" for testing purposes.
filename: 'bundle.js', // Really, you want to upload index.html and assets/bundle.js
},
devtool: 'inline-source-map',
module: {
rules: [
{
test: /\.ts?$/,
exclude: [/(node_modules|bower_components)/],
loader: 'ts-loader',
},
{
test: /\.js?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader',
},
],
},
},
];