-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
63 lines (61 loc) · 2.39 KB
/
webpack.config.js
File metadata and controls
63 lines (61 loc) · 2.39 KB
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
var webpack = require('webpack');
var BowerWebpackPlugin = require('bower-webpack-plugin');
var BrowserSyncPlugin = require('browser-sync-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var path = require('path');
var extractCSS = new ExtractTextPlugin('css/style.css');
module.exports = {
options: {
progress: true
},
entry: {
app: './app/Views/_assets/entry.js'
},
output: {
path: './public/assets/',
filename: 'js/[name].js',
publicPath: '/assets/'
},
resolve: {
root: [path.join(__dirname, 'bower_components')],
moduleDirectories: ['bower_components'],
extensions: ['', '.js', '.css', 'scss']
},
module: {
loaders: [
{ test: /\.css$/, loader: extractCSS.extract('style-loader', 'css-loader?includePaths[]=' + path.resolve(__dirname, './node_modules/compass-mixins/lib')) },
{ test: /\.scss$/, loader: extractCSS.extract(['css-loader?includePaths[]=' + path.resolve(__dirname, './node_modules/compass-mixins/lib'), 'sass-loader?includePaths[]=' + path.resolve(__dirname, './node_modules/compass-mixins/lib')]) },
{ test: /\.svg$/, loader: 'file?name=fonts/[name].[ext]' },
{ test: /\.woff$/, loader: 'file?name=fonts/[name].[ext]' },
{ test: /\.woff2$/, loader: 'file?name=fonts/[name].[ext]' },
{ test: /\.eot$/, loader: 'file?name=fonts/[name].[ext]' },
{ test: /\.ttf$/, loader: 'file?name=fonts/[name].[ext]' },
{ test: /\.jpg$/, loader: 'file?name=img/parts/[name].[ext]' },
{ test: /\.jpeg$/, loader: 'file?name=img/parts/[name].[ext]' },
{ test: /\.gif$/, loader: 'file?name=img/parts/[name].[ext]' },
{ test: /\.bmp$/, loader: 'file?name=img/parts/[name].[ext]' },
]
},
plugins: [
new BowerWebpackPlugin(),
new webpack.optimize.UglifyJsPlugin(),
extractCSS,
new BrowserSyncPlugin(
{
host: 'localhost',
port: 2001,
proxy: 'http://localhost:2000/',
watchTask: true,
ghostMode: {
scroll: true,
links: true,
forms: true
},
files: "./app/Views/**"
},
{
reload: true
}
)
]
}