Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class EnableLintAfter1stCompilationPlugin {
- constructor() {
- this.builds = {
- milos: false,
- tilos: false,
- };
- }
- apply(compiler) {
- compiler.plugin('done', (stats) => {
- if (stats.compilation.entrypoints.milos) {
- this.builds.milos = true;
- }
- });
- compiler.plugin('make', (cmp, cb) => {
- if (this.builds.milos && cmp.options.entry.milos) {
- cmp.options.module.rules.push({
- enforce: 'pre',
- test: /\.js$/,
- use: {
- loader: 'eslint-loader',
- options: {
- cache: true,
- },
- },
- exclude: /node_modules/,
- });
- }
- cb();
- });
- }
- }
Add Comment
Please, Sign In to add comment