-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.dev.js
61 lines (60 loc) · 1.47 KB
/
webpack.dev.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
58
59
60
61
const merge = require('webpack-merge');
const common = require('./webpack.common.js');
const path = require('path');
const webpack = require('webpack');
module.exports = merge(common, {
entry: {
bundle: ['./integration/index.tsx'],
},
resolve: {
modules: ['node_modules'],
extensions: ['.ts', '.tsx', '.js', '.css'],
},
module: {
rules: [
{
test: /\.ts(x)?$/,
enforce: 'pre',
loader: 'tslint-loader',
options: {},
},
{
test: /\.js$/,
use: ['source-map-loader'],
enforce: 'pre',
},
{
test: /\.ts(x?)$/,
use: ['awesome-typescript-loader'],
exclude: [/\.test\.ts(x?)$/, /dist\/.*\.d\.ts$/],
},
{
test: /\.(css)$/,
use: [
'style-loader',
{
loader: 'css-loader',
options: {
modules: true,
localIdentName: '[name]__[local]___[hash:base64:5]',
importLoaders: true,
},
},
{
loader: 'postcss-loader',
options: {
plugins: function() {
return [require('postcss-cssnext'), require('postcss-import')];
},
},
},
],
},
],
},
plugins: [new webpack.HotModuleReplacementPlugin()],
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js',
},
});