Skip to content

Instantly share code, notes, and snippets.

@KleeUT
Last active May 17, 2022 16:55
Show Gist options
  • Save KleeUT/d82e2ec63a1b9a006ae6 to your computer and use it in GitHub Desktop.
Save KleeUT/d82e2ec63a1b9a006ae6 to your computer and use it in GitHub Desktop.
Webpack test config file
var webpack = require('webpack');
module.exports = {
entry: [
"mocha\!./client/test/test.js" // The mocha loader command pointing to the test root. Note the ! is escaped.
],
output: {
path: __dirname + '/client/test/', // Path to where I want testBundle.js to be put
filename: "testBundle.js"
},
module: {
loaders: [
{ test: /\.jsx$/, loaders: ['jsx-loader'], exclude: /node_modules/},
{ test: /\.js?$/, loaders: ['babel'], exclude: /node_modules/ },
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader'},
{ test: /\.css$/, loader: "style!css" },
{ test: /\.woff$/, loader: "url-loader?limit=10000&minetype=application/font-woff" },
{ test: /\.woff2$/, loader: "url-loader?limit=10000&minetype=application/font-woff" },
{ test: /\.ttf$/, loader: "file-loader" },
{ test: /\.eot$/, loader: "file-loader" },
{ test: /\.svg$/, loader: "file-loader" },
{ test: /\.ico$/, loader: "file-loader" }
]
},
plugins: [
new webpack.NoErrorsPlugin()
],
externals:{ // Code loaded from cdn
"google":"google",
"io":"io",
"React":"React",
"ReactDom":"ReactDom"
}
};
@plutotv-aaa
Copy link

How do you actually write a test to test the webpack config dev itself?

Did you ever figure this out?

@pjones2012
Copy link

Did we get a resolution on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment