-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
54 lines (43 loc) · 1.39 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const cssExtractTextPlugin = new ExtractTextPlugin("[name].css");
const htmlExtractTextPlugin = new ExtractTextPlugin("[name].html");
module.exports = {
entry: './application.js',
output: {
filename: 'application.js',
path: `${__dirname}/dist/out/`
},
devtool: 'source-map',
resolve: {
extensions: ['.js', '.css', '.scss', '.html']
},
module: {
loaders: [
{
test: /\.ts$/,
loader: "awesome-typescript-loader",
exclude: /(node_modules|bower_components)/
},
{
test: /\.js$/,
loader: "source-map-loader",
exclude: /(node_modules|bower_components)/
},
{
test: /\.css$/,
loader: cssExtractTextPlugin.extract({fallback: "style-loader", use: "css-loader"})
},
{
test: /\.scss$/,
loader: cssExtractTextPlugin.extract({fallback: "style-loader", use: "css-loader!sass-loader"})
},
{
test: /\.html$/,
loader: htmlExtractTextPlugin.extract({fallback: "html-loader", use: "html-loader"})
},
],
},
plugins: [
cssExtractTextPlugin, htmlExtractTextPlugin
],
};