-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathwebpack-dev.config.js
executable file
·59 lines (57 loc) · 1.42 KB
/
webpack-dev.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
var path = require('path');
var webpack = require('webpack');
var loaders = require("./webpack-loaders");
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var autoprefixer = require('autoprefixer');
var precss = require('precss');
var PATHS = {
app: path.join(__dirname, 'src/index.dev.ts'),
build: path.join(__dirname, 'builds'),
dist: path.join(__dirname, 'dist')
};
module.exports = {
devtool: "source-map",
watch: true,
cache: true,
debug: true,
entry: {
app: [
'webpack-dev-server/client?http://localhost:8000',
'webpack/hot/dev-server',
PATHS.app
]
},
output: {
path: PATHS.build,
filename: '[name].js',
publicPath: PATHS.build,
sourceMapFilename: '[name].js.map',
chunkFilename: '[id].chunk.js',
devtoolModuleFilenameTemplate: function(info){
return "file:///"+info.absoluteResourcePath;
}
},
resolve: {
root: __dirname,
extensions: ['', '.ts', '.js', '.json', '.scss']
},
module: {
preLoaders: [
{
test: /\.ts$/,
loader: "tslint"
}
],
loaders: loaders
},
postcss: function () {
return [autoprefixer, precss];
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new webpack.optimize.OccurenceOrderPlugin(true),
new webpack.optimize.DedupePlugin(),
new ExtractTextPlugin("app.css", { allChunks: true })
]
};