-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathwebpack.config.js
executable file
·70 lines (62 loc) · 1.49 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
62
63
64
65
66
67
68
69
70
var path = require("path");
var webpack = require("webpack");
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var nodePath = path.join(__dirname, "node_modules");
module.exports = {
context: __dirname + "/client",
entry: {
app: "./main.jsx",
html: "./index.html"
},
output: {
path: __dirname + "/dist",
filename: "[name].js",
sourceMapFilename: "[file].map",
publicPath: __dirname + "/dist/"
},
resolve: {
cache: true,
alias: {
"lodash" : "lodash",
"jQuery" : "jquery",
"materialize-css" : path.join(nodePath, "materialize-css", "bin", "materialize.css"),
"c3-css" : path.join(nodePath, "c3", "c3.css")
},
extensions: ["", ".js", ".json", ".coffee", ".css"]
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loaders: ["babel-loader"],
},
{
test: /\.html$/,
loader: "file?name=[name].[ext]",
},
{
test: /\.(woff2|woff|ttf|eot)$/,
loader: "file?name=fonts/[name].[ext]",
},
{
test: /\.(css|less)$/,
loader: ExtractTextPlugin.extract("css-loader!less-loader")
},
{
test: /\.(png|jpg|svg|ico)$/,
loader: "file-loader?name=[path][name].[ext]"
},
],
},
plugins: [
new ExtractTextPlugin("[name].css", {
allChunks: true
}),
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery"
})
],
devtool: "source-map",
}