forked from jgraichen/redmine_dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
54 lines (50 loc) · 1.46 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
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var webpack = require('webpack');
var autoprefixer = require('autoprefixer');
var csswring = require('csswring');
var path = require('path');
var sass = 'sass' +
'?indentedSyntax=sass' +
'&includePaths[]=' + (path.resolve(__dirname, "./node_modules"));
var plugins = [
new ExtractTextPlugin("[name].css", { allChunks: true }),
new webpack.EnvironmentPlugin(['NODE_ENV']),
new webpack.IgnorePlugin(new RegExp("^(jquery)$"))
]
module.exports = {
target: 'web',
entry: [
'./app/assets/main.coffee',
'./app/assets/main.sass'
],
output: {
path: "assets",
filename: "[name].js",
chunkFilename: "[name].[id].[chunkhash].js"
},
resolve: {
fallback: path.join(__dirname, "node_modules"),
extensions: ['', '.js', '.coffee', '.sass'],
alias: {
// Use single global react
'react': path.dirname(require.resolve('react'))
}
},
resolveLoader: {
fallback: path.join(__dirname, "node_modules")
},
module: {
loaders: [
{ test: /exoskeleton.js$/, loader: 'imports?define=>false' },
{ test: /\.coffee$/, loader: 'coffee' },
{ test: /\.sass$/, loader: ExtractTextPlugin.extract('css!postcss!' + sass) },
{ test: /\.yml$/, loader: 'json!yaml' },
{ test: /\.(ttf|eot|svg|woff2?)(\?.*)?$/, loader: "file?name=[name]-[hash].[ext]" },
]
},
postcss: [
autoprefixer,
csswring
],
plugins: plugins
};