Last active
May 6, 2016 06:49
-
-
Save sdtsui/feb5f1de7c7c53e6e42180f201d890cd to your computer and use it in GitHub Desktop.
stylelint-webpack-plugin-#3
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
const webpack = require('webpack'); | |
const path = require('path'); | |
const FlowStatusWebpackPlugin = require('flow-status-webpack-plugin'); | |
// const styleLintPlugin = require('stylelint-webpack-plugin'); | |
// const globPath = path.join(__dirname, 'app') + '/**/*.css'; | |
// const globPath = path.join(__dirname, 'app', 'js', 'components', '404Page') + '/404Page.css'; | |
// console.log("PATH ::", globPath); | |
module.exports = { | |
debug: true, | |
devtool: 'source-map', | |
context: path.join(__dirname, 'app', 'js'), | |
entry: [ | |
'webpack/hot/dev-server', | |
'webpack-hot-middleware/client', | |
'./main', | |
], | |
output: { | |
path: path.join(__dirname, 'app', 'js'), | |
publicPath: '/js/', | |
filename: 'bundle.js', | |
}, | |
plugins: [ | |
new webpack.optimize.OccurenceOrderPlugin(), | |
new webpack.HotModuleReplacementPlugin(), | |
new webpack.NoErrorsPlugin(), | |
new FlowStatusWebpackPlugin(), | |
// new styleLintPlugin({ | |
// configFile: '.stylelintrc', | |
// context: 'inherits from webpack', | |
// // files: '**/*.s?(a|c)ss', | |
// files: '**/*.css', | |
// // files: '../../**/*.css', //TODO: Cleanup, exclude node_modules | |
// files: globPath, //TODO: Cleanup, exclude node_modules | |
// configBasedir: path.join(__dirname), | |
// failOnError: false, | |
// }), | |
], | |
module: { | |
loaders: [ | |
{ test: /\.jsx?$/, exclude: /node_modules/, loaders: ['react-hot', 'babel'] }, | |
{ | |
test: /\.css$/, | |
loaders: [ | |
'style?singleton', | |
'css?modules', | |
'postcss-loader' | |
], | |
}, | |
{ test: /\.svg$/, loader: 'url-loader?limit=10000&mimetype=image/svg+xml' }, | |
], | |
}, | |
postcss: function() { | |
return [ | |
require('postcss-cssnext'), | |
]; | |
}, | |
resolve: { | |
extensions: [ | |
'', | |
'.js', '.jsx', | |
], | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment