Skip to content

Commit

Permalink
Update webpack test config and linting from npm
Browse files Browse the repository at this point in the history
  • Loading branch information
javivelasco committed Jul 12, 2016
1 parent b7bd84d commit 2a735cd
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -102,7 +102,7 @@
"babel": "babel ./components --out-dir ./lib",
"build": "cross-env NODE_ENV=production npm run babel && npm run sass && npm run tsd",
"clean": "rimraf ./lib",
"lint": "npm run lint:js && npm run lint:scss",
"lint": "npm run lint:js && npm run lint:scss && npm run lint:css",
"lint:js": "eslint ./ --ext .js",
"lint:scss": "sass-lint ./components/**/*.scss -v -i ./components/slider/style.scss",
"lint:css": "stylelint ./components/**/*.css",
Expand Down
39 changes: 26 additions & 13 deletions webpack.config.test.js
@@ -1,25 +1,38 @@
const path = require('path');
const webpack = require('webpack');
const autoprefixer = require('autoprefixer');

module.exports = {
module: {
loaders: [
{
test: /\.js$/,
exclude: /(node_modules)/,
loader: 'babel'
}, {
test: /\.(scss|css)$/,
loader: 'style!css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss!sass'
}
]
loaders: [{
test: /\.js$/,
include: [path.join(__dirname, './components'), path.join(__dirname, './spec')],
loader: 'babel'
}, {
test: /\.css$/,
include: /node_modules/,
loaders: ['style-loader', 'css-loader']
}, {
test: /\.(scss|css)$/,
include: [path.join(__dirname, './components'), path.join(__dirname, './spec')],
loader: 'style!css?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss!sass?sourceMap'
}]
},
resolve: {
extensions: ['', '.scss', '.js', '.json'],
extensions: ['', '.css', '.scss', '.js', '.json'],
packageMains: ['browser', 'web', 'browserify', 'main', 'style']
},
watch: true,
postcss: [autoprefixer],
postcss (webpackInstance) {
return [
require('postcss-import')({
addDependencyTo: webpackInstance,
root: __dirname,
path: [path.join(__dirname, './components')]
}),
require('postcss-cssnext')(),
require('postcss-reporter')({ clearMessages: true })
];
},
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('test')
Expand Down

0 comments on commit 2a735cd

Please sign in to comment.