-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
116 lines (114 loc) · 3.14 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
var path = require("path"),
webpack = require("webpack"),
ExtractTextPlugin = require("extract-text-webpack-plugin"),
ManifestRevisionPlugin = require("manifest-revision-webpack-plugin")
var root = "./assets"
module.exports = {
entry: {
app_js: [
root + "/scripts/app.js"
],
bootstrap_js: [
root + "/scripts/bootstrap.js"
],
jquery_js: [
root + "/scripts/jquery.1.8.3.min.js"
],
jquery_ease_js: [
root + "/scripts/jquery.easing.1.3.js"
],
jquery_isotope_js: [
root + "/scripts/jquery.isotope.js"
],
classie_js: [
root + "/scripts/classie.js"
],
main_css: [
root + "/styles/main.scss"
],
styles_css: [
root + "/styles/styles.css"
],
bootstrap_css: [
root + "/styles/bootstrap.css"
],
font_awesome_css: [
root + "/styles/font-awesome.css"
],
responsive_css: [
root + "/styles/responsive.css"
],
animate_css: [
root + "/styles/animate.css"
]
},
output: {
path: path.join(__dirname, "app/public"),
publicPath: "/assets/",
filename: "[name].[chunkhash].js",
chunkFilename: "[id].[chunkhash].chunk"
},
resolve: {
extensions: [".js", ".jsx", ".scss", ".css"]
},
module: {
loaders: [
{
test: /\.js$/i,
exclude: /node_modules/,
loader: "babel-loader"
},
{
test: /\.scss$/i,
loader: ExtractTextPlugin.extract("css-loader!sass-loader")
},
{
test: /\.css$/i,
use: ['css-hot-loader'].concat(ExtractTextPlugin.extract({
fallback: 'style-loader',
use: 'css-loader'
})),
},
{
test: /\.(ttf|otf|eot|svg|woff)$/i,
loader: 'file-loader'
},
{
test: /\.jsx?$/i,
loader: 'babel-loader',
exclude: /node_modules/,
query:
{
presets:['react', 'env', 'stage-1']
}
},
{
test: /\.(gif|png|jpe?g|svg)$/i,
use: [
'file-loader',
{
loader: 'image-webpack-loader',
options: {
bypassOnDebug: true,
},
},
],
}
],
},
plugins: [
new ExtractTextPlugin("[name].[chunkhash].css"),
new ManifestRevisionPlugin(path.join("app", "manifest.json"), {
rootAssetPath: root,
ignorePaths: ["/styles", "/scripts"]
}),
new webpack.optimize.UglifyJsPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.DefinePlugin({
"process.env": {
NODE_ENV: '"production"'
}
}),
new webpack.NoEmitOnErrorsPlugin()
]
}