Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand Down
2 changes: 1 addition & 1 deletion test/ignores.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down