Skip to content

Instantly share code, notes, and snippets.

@sdtsui
Last active May 6, 2016 06:49
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 sdtsui/feb5f1de7c7c53e6e42180f201d890cd to your computer and use it in GitHub Desktop.
Save sdtsui/feb5f1de7c7c53e6e42180f201d890cd to your computer and use it in GitHub Desktop.
stylelint-webpack-plugin-#3
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