-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.production.config.js
More file actions
54 lines (49 loc) · 1.85 KB
/
Copy pathwebpack.production.config.js
File metadata and controls
54 lines (49 loc) · 1.85 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
var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var CopyWebpackPlugin = require('copy-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var autoprefixer = require('autoprefixer');
module.exports = {
entry: [
'bootstrap-loader',
'font-awesome-sass-loader!./font-awesome.production.config.js',
path.join(__dirname, "src", "index.js")
],
output: {
path: path.join(__dirname, "dist"),
filename: "assets/[name]-[hash].js",
publicPath: '/'
},
module: {
loaders: [
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel' },
{ test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'url-loader?limit=10000&mimetype=application/font-woff&name=/assets/[name]-[hash].[ext]' },
{ test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'file-loader?name=/assets/[name]-[hash].[ext]' },
{ test: /\.css$/, loaders: ExtractTextPlugin.extract('style', 'css!postcss') },
{ test: /\.scss$/, loader: ExtractTextPlugin.extract('style', 'css!postcss!sass') },
]
},
postcss: [ autoprefixer({ browsers: ['last 2 versions'] }) ],
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development'),
VERSION: JSON.stringify(require('git-repo-version')()),
FHIR_SERVER: JSON.stringify('http://localhost:3001')
}),
new HtmlWebpackPlugin({
template: path.join(__dirname, "src", "index.tmpl.html")
}),
new CopyWebpackPlugin([
{ from: 'public' },
{ from: 'src/images', to: 'assets/images' }
]),
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery"
}),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin(),
new ExtractTextPlugin("assets/[name]-[hash].css")
]
};