-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathwebpack.config.js
61 lines (53 loc) · 1.57 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
55
56
57
58
59
60
61
var path = require("path");
var webpack = require("webpack");
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var nodePath = path.resolve(__dirname, "node_modules");
var distPath = path.resolve(__dirname, "static/dist");
var jsPath = path.resolve(__dirname, "static/javascripts");
module.exports = {
entry: {
index : path.join(jsPath, "main.jsx"),
success : path.join(jsPath, "success.jsx"),
},
output: {
path: distPath,
filename: "[name].js",
sourceMapFilename: "[file].map",
publicPath: distPath
},
resolve: {
extensions: ["", ".js", ".jsx", ".json", ".coffee", ".css", ".scss"]
},
module: {
loaders: [
{
test: /\.jsx$/,
exclude: /node_modules/,
loader: "babel-loader",
query: {stage: 0}
},
{
test: /\.html$/,
loader: "file?name=[name].[ext]"
},
{
test: /\.(woff2|woff|ttf|eot)$/,
loader: "file?name=fonts/[name].[ext]"
},
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract(
'css-loader?sourceMap!sass-loader?sourceMap=true&sourceMapContents=true'
)
},
{
test: /\.(png|jpg|svg|ico)$/,
loader: "file-loader?name=[path][name].[ext]"
}
]
},
plugins: [
new ExtractTextPlugin("[name].css"),
],
devtool: "source-map"
}