-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Cameron J Roe
committed
Sep 6, 2016
1 parent
e5fceb6
commit ef9e21f
Showing
3 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import path from 'path' | ||
import webpack from 'webpack' | ||
|
||
export default { | ||
entry: path.resolve(__dirname, './src/assets/js/index.js'), | ||
output: { | ||
path: path.resolve(__dirname, './dist/assets/js'), | ||
filename: 'bundle.js' | ||
}, | ||
module: { | ||
loaders: [] | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import path from 'path'; | ||
import configureWebpack from '../src/config/configure-webpack'; | ||
import createDefaults from '../src/config/defaults'; | ||
import { | ||
expect | ||
} from 'chai'; | ||
|
||
describe('webpack config', () => { | ||
|
||
it('should override module.loaders completely', function(done) { | ||
var config = configureWebpack({ | ||
basePath: path.resolve(__dirname, './fixtures/webpack'), | ||
webpack: { | ||
dev: './webpack.config.js', | ||
prod: './webpack.config.js' | ||
} | ||
}) | ||
expect(config.dev.module.loaders).to.have.lengthOf(0) | ||
done(); | ||
}); | ||
|
||
it('should keep original module.loaders in tact', function(done) { | ||
var config = configureWebpack({ | ||
basePath: path.resolve(__dirname, './fixtures/webpack'), | ||
bower: true, | ||
jquery: true | ||
}) | ||
expect(config.dev.module.loaders).to.have.lengthOf(4) | ||
done(); | ||
}); | ||
|
||
it('should create correct defaults without loaders', function(done) { | ||
var defaults = createDefaults({ | ||
basePath: path.resolve(__dirname, './fixtures/webpack'), | ||
bower: true, | ||
jquery: true, | ||
webpack: { | ||
dev: './webpack.config.js', | ||
prod: './webpack.config.js' | ||
} | ||
}) | ||
expect(defaults.webpack.dev.module.loaders).to.have.lengthOf(0) | ||
done(); | ||
}); | ||
|
||
it('should create correct defaults with default loaders', function(done) { | ||
var defaults = createDefaults({ | ||
basePath: path.resolve(__dirname, './fixtures/webpack'), | ||
bower: true, | ||
jquery: true | ||
}) | ||
expect(defaults.webpack.dev.module.loaders).to.have.lengthOf(4); | ||
done(); | ||
}); | ||
|
||
}) |