-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This required config changes. Also fixed duplicated PostCSS warning messages appearing in the console since postcss-reporter was updated. Closes #17 and somehow fixes #20.
- Loading branch information
1 parent
2b3950a
commit 0ee1227
Showing
3 changed files
with
378 additions
and
135 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,54 @@ | ||
const path = require('path') | ||
const webpack = require('webpack') | ||
const ExtractTextPlugin = require('extract-text-webpack-plugin') | ||
const atImport = require('postcss-import') | ||
const cssnext = require('postcss-cssnext') | ||
const reporter = require('postcss-reporter') | ||
|
||
module.exports = { | ||
entry: [ | ||
'./components/app/index.js', | ||
'./components/app/index.css' | ||
], | ||
output: { | ||
path: path.resolve('./bundle'), | ||
path: './bundle', | ||
filename: 'bundle.js' | ||
}, | ||
devtool: 'source-map', | ||
module: { | ||
loaders: [{ | ||
test: /\.js$/, | ||
exclude: /node_modules/, | ||
loader: 'babel?cacheDirectory' | ||
}, { | ||
test: /\.css$/, | ||
loader: ExtractTextPlugin.extract('style', 'css?sourceMap&-autoprefixer&importLoaders=1!postcss') | ||
}] | ||
rules: [ | ||
{ | ||
test: /\.js$/, | ||
exclude: /node_modules/, | ||
loader: 'babel-loader', | ||
options: { | ||
cacheDirectory: true | ||
} | ||
}, | ||
{ | ||
test: /\.css$/, | ||
loader: ExtractTextPlugin.extract({ | ||
fallbackLoader: 'style-loader', | ||
loader: [ | ||
{ | ||
loader: 'css-loader', | ||
query: { | ||
importLoaders: 1, | ||
sourceMap: true | ||
} | ||
}, | ||
{ | ||
loader: 'postcss-loader' | ||
} | ||
] | ||
}) | ||
} | ||
] | ||
}, | ||
plugins: [ | ||
new webpack.ProvidePlugin({ | ||
'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch' | ||
'fetch': 'imports-loader?this=>global!exports-loader?global.fetch!whatwg-fetch' | ||
}), | ||
new webpack.optimize.UglifyJsPlugin({ | ||
compress: { | ||
warnings: false | ||
} | ||
comments: false, | ||
sourceMap: true | ||
}), | ||
new ExtractTextPlugin('bundle.css') | ||
], | ||
postcss: [ | ||
atImport, | ||
cssnext, | ||
reporter({clearMessages: true}) | ||
] | ||
} |
Oops, something went wrong.