This repository has been archived by the owner on May 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 348
/
webpack.config.js
69 lines (61 loc) · 1.86 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
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, "dist/js/mod");
var jsPath = path.resolve(__dirname, "hub/static/jsx");
module.exports = {
entry: {
register : path.join(jsPath, 'register.jsx'),
login : path.join(jsPath, 'login.jsx'),
vendors : ['jquery']
},
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("css/[name].css"),
new webpack.optimize.CommonsChunkPlugin("vendors", "vendors.js", Infinity),
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
"window.jQuery": "jquery",
"root.jQuery": "jquery"
})
],
devtool: "source-map"
}