-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.production.config.js
91 lines (81 loc) · 2.17 KB
/
webpack.production.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
'use strict'
let BowerWebpackPlugin = require('bower-webpack-plugin')
let path = require('path')
let Webpack = require('webpack')
let HtmlWebpackPlugin = require('html-webpack-plugin')
let ExtractTextPlugin = require('extract-text-webpack-plugin');
let CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
devtool: 'source-map',
entry: [
path.resolve(__dirname, 'js', 'bootstrap.js')
],
output: {
filename: 'app.js',
path: path.resolve(__dirname, 'dist'),
publicPath: '',
sourceMapFilename: 'app.js.map'
},
module: {
loaders: [
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract('css!sass')
},
{
test: /\.(eot|woff|woff2|ttf|svg|png|jpe?g|gif)(\?\S*)?$/,
loader: 'url?limit=100000&name=[name].[ext]'
},
{
test: /\.js|\.jsx$/,
exclude: /(node_modules|bower_components)/,
loaders: ['babel']
},
{
test: /\.json$/,
loaders: ['json']
}
]
},
plugins: [
new Webpack.optimize.OccurenceOrderPlugin(),
new Webpack.NoErrorsPlugin(),
new BowerWebpackPlugin({
excludes: [
/.*\.css$/,
/.*\.less/,
/.*\.scss$/
]
}),
new CopyWebpackPlugin([ { from: 'assets/**/*', to: '.' } ]),
new Webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
_: 'lodash'
}),
new Webpack.ResolverPlugin(
new Webpack.ResolverPlugin.DirectoryDescriptionFilePlugin(".bower.json", ["main"])
),
new ExtractTextPlugin('/app.css', { allChunks: true }),
new HtmlWebpackPlugin({
title: 'Pine Cliff Woodworks - Board Builder',
template: 'templates/index.ejs',
favicon: 'assets/favicon.png',
inject: false
})
],
resolve: {
modulesDirectories: ["node_modules", "bower_components"],
alias: {
collections: path.resolve(__dirname, 'js', 'collections'),
models: path.resolve(__dirname, 'js', 'models'),
three: path.resolve(__dirname, 'bower_components', 'three.js', 'examples', 'js'),
views: path.resolve(__dirname, 'js', 'views')
}
},
stats: {
colors: true,
reasons: true
},
target: 'web'
}