Skip to content

Instantly share code, notes, and snippets.

@gplume
Last active January 29, 2017 13:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gplume/c935111fc9634583a43936f309a424ba to your computer and use it in GitHub Desktop.
Save gplume/c935111fc9634583a43936f309a424ba to your computer and use it in GitHub Desktop.
module.exports = {
styleLoader: require('extract-text-webpack-plugin').extract(
{
fallbackLoader: 'style-loader',
loader: 'css-loader!sass-loader'
}
),
styles: {
'mixins': true,
'bordered-pulled': false,
'core': true,
'fixed-width': true,
'icons': true,
'larger': true,
'list': true,
'path': true,
'rotated-flipped': false,
'animated': true,
'stacked': false
}
};
{
"name": "fa-gist",
"description": "---",
"version": "0.0.1",
"author": "gplume",
"private": true,
"scripts": {
"build": "cross-env NODE_ENV=production webpack --config webpack.config.js --progress --hide-modules"
},
"dependencies": {
"font-awesome": "^4.7.0"
},
"devDependencies": {
"cross-env": "^3.0.0",
"css-loader": "^0.25.0",
"extract-text-webpack-plugin": "2.0.0-beta.4",
"file-loader": "^0.9.0",
"font-awesome-loader": "^1.0.1",
"imports-loader": "^0.6.5",
"node-sass": "4.1.0",
"resolve-url-loader": "^1.6.0",
"sass-loader": "4.1.1",
"style-loader": "^0.13.1",
"url-loader": "^0.5.7",
"webpack": "^2.2.0"
}
}
var path = require('path')
var webpack = require('webpack')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
module.exports = {
entry: {
main: ['font-awesome-loader!./font-awesome.config.js'],
},
output: {
path: 'dist',
publicPath: '/dist/',
filename: '[name].js',
},
plugins: [
new ExtractTextPlugin({
filename: 'main.css',
allChunks: true
}),
new webpack.optimize.UglifyJsPlugin({
sourceMap: true,
compress: {
warnings: false,
drop_debugger: true,
drop_console: true
},
output: {
comments: false
}
}),
new webpack.LoaderOptionsPlugin({
minimize: true
})
],
module: {
rules: [
{
test: /\.woff2?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
use: "url-loader?limit=10000"
},
{
test: /\.(ttf|eot|otf|svg)(\?[\s\S]+)?$/,
use: 'file-loader',
},
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallbackLoader: 'style-loader',
loader: 'css-loader',
})
},
{
test: /\.scss$/,
use: ExtractTextPlugin.extract({
fallbackLoader: 'style-loader',
loader: 'css-loader!sass-loader',
})
}
],
},
devtool: 'cheap-module-source-map',
performance: {
hints: false
}
}
if (process.env.NODE_ENV === 'production') {
module.exports.devtool = false
module.exports.plugins = (module.exports.plugins || []).concat([
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
sourceMap: false,
compress: {
warnings: false,
},
output: {
comments: false
}
}),
new webpack.LoaderOptionsPlugin({
minimize: true
})
])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment