Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function webpackBuild(filename, libraryName, version) {
// If this build is part of a pull request, include the pull request number in
// the version number.
if (process.env.CIRCLE_PR_NUMBER) {
version += '+pr.' + process.env.CIRCLE_PR_NUMBER;
}
const typeofPlugin = require("babel-plugin-transform-es2015-typeof-symbol")
.default;
// babel-plugin-transform-es2015-typeof-symbol is not idempotent, and something
// else is already running it, so we need to exclude it from the transform.
const preset2015 = require("babel-preset-es2015").default();
const es2015WithoutTypeof = {
plugins: preset2015.plugins.filter(plugin => plugin !== typeofPlugin),
};
const config = {
module: {
rules: [
{
//exclude: /node_modules/,
test: /\.js$/,
loader: "babel-loader",
options: {
// Some of the node_modules may have their own "babel" section in
// their project.json (or a ".babelrc" file). We need to ignore
// those as we're using our own Babel options.
babelrc: false,