-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
98 lines (88 loc) · 2.33 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
'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: [
'webpack/hot/dev-server',
'webpack-hot-middleware/client',
path.resolve(__dirname, 'js', 'bootstrap.js')
],
output: {
filename: 'app.js',
path: path.resolve(__dirname, 'dist'),
publicPath: '/',
sourceMapFilename: 'app.js.map'
},
module: {
loaders: [
{
test: /\.scss$/,
// include: /scss/, //remove me?
loaders: [
'style',
'css',
'sass?outputStyle=expanded'
]
},
{
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: ['react-hot', 'babel']
},
{
test: /\.json$/,
loaders: ['json']
}
]
},
plugins: [
new Webpack.optimize.OccurenceOrderPlugin(),
new Webpack.HotModuleReplacementPlugin(),
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 HtmlWebpackPlugin({
title: 'LOCAL 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'
}