diff --git a/lib/config.js b/lib/config.js index de44670..7eea2b2 100644 --- a/lib/config.js +++ b/lib/config.js @@ -161,30 +161,35 @@ module.exports = class Config { // core ignores opts.ignore.unshift( - '**/node_modules/**', // node_modules folder - `${this.output.path}/**/*`, // anything in the public folder - '**/.git/**', // any git content - '**/package.json', // the primary package.json file + 'node_modules/**', // node_modules folder + `${opts.outputDir}/**`, // anything in the public folder + '.git/**', // any git content + 'package.json', // the primary package.json file '**/.DS_Store', // any dumb DS Store file - `${this.context}/app.js`, // primary config - `${this.context}/app.*.js` // any environment config + 'app.js', // primary config + 'app.*.js' // any environment config ) + // Loader excludes use absolute paths for some reason, so we add the context + // to the beginning of the path so users can input them as relative to root. + opts.ignore = opts.ignore.map((i) => path.join(this.context, i)) + const reIgnores = opts.ignore.map(mmToRe) + const spikeLoaders = [ { - exclude: opts.ignore.map(mmToRe), + exclude: reIgnores, loader: 'css-loader!postcss-loader', _core: 'css' }, { - exclude: opts.ignore.map(mmToRe), + exclude: reIgnores, loader: 'babel-loader', _core: 'js' }, { - exclude: opts.ignore.map(mmToRe), + exclude: reIgnores, loader: 'jade-static-loader', _core: 'jade' }, { - exclude: opts.ignore.map(mmToRe), + exclude: reIgnores, loader: 'source-loader', _core: 'static' } diff --git a/test/ignores.js b/test/ignores.js index 8cb851a..650ef4c 100644 --- a/test/ignores.js +++ b/test/ignores.js @@ -3,7 +3,7 @@ const path = require('path') const {compileFixture, fs} = require('./_helpers') test('does not compile ignored files', (t) => { - return compileFixture(t, 'ignores', { ignore: ['**/layout.jade'] }).tap(({publicPath}) => { + return compileFixture(t, 'ignores', { ignore: ['layout.jade'] }).tap(({publicPath}) => { return fs.access(path.join(publicPath, 'index.html')) }).tap(({publicPath}) => { return fs.access(path.join(publicPath, 'about.html'))