Created
February 24, 2016 13:27
-
-
Save ALF-er/8f98970a0dfda43f1417 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*eslint-disable */ | |
const webpack = require("webpack"); | |
const path = require("path"); | |
const HtmlWebpackPlugin = require("html-webpack-plugin"); | |
const autoprefixer = require("autoprefixer"); | |
module.exports = { | |
entry: { | |
main: path.join(__dirname, "src", "javascripts", "index.js") | |
}, | |
output: { | |
path: path.join(__dirname, "dist"), | |
filename: "[name].js", | |
publicPath: "/" | |
}, | |
module: { | |
loaders: [ | |
{ | |
test: /\.(js|jsx)$/, | |
include: path.join(__dirname, "src"), | |
loaders: [ | |
"babel" | |
], | |
}, | |
{ | |
test: /\.scss$/, | |
loaders: [ | |
"style", | |
"css", | |
"postcss", | |
"sass" | |
] | |
}, | |
{ | |
test: /\.css$/, | |
loaders: [ | |
"style", | |
"css", | |
"postcss" | |
] | |
}, | |
{ | |
test: /\.json$/, | |
loaders: [ | |
"json" | |
] | |
}, | |
{ | |
test: /\.(png|jpg|gif)$/, | |
loaders: [ | |
"url?limit=50000" | |
] | |
}, | |
{ | |
test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, | |
loader: "url?limit=10000&mimetype=application/font-woff" | |
}, | |
{ | |
test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, | |
loader: "url?limit=10000&mimetype=application/font-woff" | |
}, | |
{ | |
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, | |
loader: "url?limit=10000&mimetype=application/octet-stream" | |
}, | |
{ | |
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, | |
loader: "file" | |
}, | |
{ | |
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, | |
loader: "url?limit=10000&mimetype=image/svg+xml" | |
} | |
] | |
}, | |
postcss: [ autoprefixer({ browsers: ["last 2 versions"] }) ], | |
resolve: { | |
extensions: ["", ".js", ".jsx", ".css", ".scss", ".less"], | |
root: [ | |
path.join(__dirname, "src", "javascripts"), | |
path.join(__dirname, "src", "images") | |
], | |
modulesDirectories: ["node_modules"] | |
}, | |
devtool: false, | |
// devtool: "#source-map", | |
stats: { | |
colors: true | |
}, | |
plugins: [ | |
new webpack.DefinePlugin({ | |
"process.env": { | |
"NODE_ENV": JSON.stringify("production") | |
}, | |
"API_ENDPOINT": process.env.npm_package_config_apiEndpoint | |
}), | |
new webpack.IgnorePlugin(/^\.\/locale$/, [/moment$/]), | |
new webpack.ProvidePlugin({ | |
jQuery: "jquery", | |
_: "underscore" | |
}), | |
new webpack.optimize.OccurrenceOrderPlugin(), | |
new HtmlWebpackPlugin({ | |
GAcode: process.env.npm_package_config_googleAnalyticsCode, | |
template: "src/index_template.html" | |
}), | |
new webpack.optimize.DedupePlugin(), | |
new webpack.optimize.UglifyJsPlugin({ | |
compress: { | |
warnings: false | |
} | |
}), | |
new webpack.optimize.AggressiveMergingPlugin() | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment