2016-11-02 19:34:08 +02:00
|
|
|
#!/usr/bin/env node
|
|
|
|
|
|
|
|
const StyleLintPlugin = require('stylelint-webpack-plugin');
|
|
|
|
const webpack = require('webpack');
|
|
|
|
const MemoryFS = require('memory-fs');
|
2016-12-05 22:34:17 +02:00
|
|
|
const config = require('../webpack/base');
|
2016-11-02 19:34:08 +02:00
|
|
|
|
|
|
|
const mfs = new MemoryFS();
|
|
|
|
const compiler = webpack(Object.assign(config, {
|
|
|
|
plugins: config.plugins.concat([
|
|
|
|
new StyleLintPlugin({
|
|
|
|
configFile: '.stylelintrc',
|
|
|
|
files: [
|
|
|
|
'**/*.css'
|
|
|
|
],
|
|
|
|
failOnError: true
|
|
|
|
})
|
|
|
|
])
|
|
|
|
}));
|
|
|
|
|
|
|
|
mfs.mkdirpSync(config.output.path);
|
|
|
|
compiler.outputFileSystem = mfs;
|
|
|
|
|
|
|
|
compiler.run((err, stats) => {
|
|
|
|
if (err) {
|
|
|
|
throw err;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
process.on('unhandledRejection', () => {
|
|
|
|
process.exit(1);
|
|
|
|
});
|