Created
February 10, 2016 18:07
-
-
Save nginnever/bd33e0fb49fbcba88d1b to your computer and use it in GitHub Desktop.
Webpack noParse example for node-forge build
This file contains hidden or 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
| module.exports = function (config) { | |
| var path = require('path') | |
| var node_modules_dir = path.join(__dirname, 'node_modules') | |
| var deps = [ | |
| 'path-to-your-bundle-file/forge.bundle.js' | |
| ] | |
| config.set({ | |
| basePath: '', | |
| frameworks: ['mocha'], | |
| files: [ | |
| 'tests/test-core/browser.js' | |
| ], | |
| preprocessors: { | |
| 'tests/test-core/*': ['webpack'] | |
| }, | |
| webpack: { | |
| resolve: { | |
| extensions: ['', '.js', '.json'], | |
| alias: {'node-forge': node_modules_dir+'/path-to-your-bundle-file/forge.bundle.js' } | |
| }, | |
| externals: { | |
| fs: '{}' | |
| }, | |
| node: { | |
| Buffer: true | |
| }, | |
| module: { | |
| loaders: [ | |
| { test: /\.json$/, loader: 'json' } | |
| ], | |
| noParse: [] | |
| }, | |
| }, | |
| webpackMiddleware: { | |
| noInfo: true, | |
| stats: { | |
| colors: true | |
| } | |
| }, | |
| reporters: ['spec'], | |
| port: 9876, | |
| colors: true, | |
| logLevel: config.LOG_INFO, | |
| autoWatch: false, | |
| browsers: process.env.TRAVIS ? ['Firefox'] : ['Chrome'], | |
| singleRun: true | |
| }) | |
| deps.forEach(function (dep) { | |
| var depPath = path.resolve(node_modules_dir, dep) | |
| config.webpack.module.noParse.push(depPath) | |
| }) | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment