-
Notifications
You must be signed in to change notification settings - Fork 3
/
webpack.config.js
57 lines (54 loc) · 1.66 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
const path = require('path');
const glob = require('glob');
const webpack = require('webpack');
const ngAnnotatePlugin = require('ng-annotate-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const mainConfig = {
name: 'main',
entry: {
application: glob.sync('./resources/assets/coffee/**/*.coffee'),
styles: './resources/assets/sass/main.scss',
},
output: {
path: __dirname + '/public/dist/',
filename: "js/[name].js",
sourceMapFilename: "js/[name].map",
publicPath: '/dist/'
},
module: {
loaders: [
{test: /\.coffee$/, use: 'coffee-loader'},
{
test: /\.(eot|svg|ttf|woff|woff2)$/,
use: 'file-loader?name=../fonts/[name].[ext]&outputPath=../dist/fonts/'
},
{
test: /\.scss$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: 'css-loader!sass-loader',
}),
},
{
test: /\.(jpe?g|png|gif)$/i,
use: 'file-loader?name=images/[name].[ext]'
},
]
},
resolve: {
extensions: ['.js', '.coffee']
},
devtool: '#cheap-module-source-map',
plugins: [
new ngAnnotatePlugin({add: true}),
new webpack.DefinePlugin({DEBUG: JSON.stringify(JSON.parse(process.env.DEBUG || 'false'))}),
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: Infinity
}),
new ExtractTextPlugin('css/style.css')
]
};
module.exports = [
mainConfig
];