joyent-portal/ui/scripts/stylelint
2016-12-05 20:34:17 +00:00

33 lines
660 B
JavaScript
Executable File

#!/usr/bin/env node
const StyleLintPlugin = require('stylelint-webpack-plugin');
const webpack = require('webpack');
const MemoryFS = require('memory-fs');
const config = require('../webpack/base');
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);
});