Created
June 20, 2019 17:56
-
-
Save jeffkamo/d06041e451d0d00bd27605459525fe56 to your computer and use it in GitHub Desktop.
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
// In your project's /web/webpack directory | |
/* eslint-env node */ | |
/* eslint-disable import/no-commonjs */ | |
const path = require('path') | |
module.exports = { | |
entry: './app/request-processor.js', | |
target: 'node', | |
output: { | |
path: path.resolve(process.cwd(), 'build'), | |
filename: 'request-processor.js', | |
// Output a CommonJS module for use in Node | |
libraryTarget: 'commonjs2' | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.js$/, | |
exclude: /node_modules/, | |
use: { | |
loader: 'babel-loader', | |
options: { | |
cacheDirectory: path.join(__dirname, 'tmp') | |
} | |
} | |
} | |
] | |
} | |
} |
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
// In your project's /web/webpack directory | |
// In the dependencies at the top, add... | |
const requestProcessorConfig = require('./base.request-processor') | |
// ... | |
// Where the configs are added together in an array, add | |
// `requestProcessorConfig` to it. | |
let configs = [mainConfig, loaderConfig, workerConfig, requestProcessorConfig] |
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
// In your project's /web/webpack directory | |
// In the dependencies at the top, add... | |
const requestProcessorConfig = require('./base.request-processor') | |
// ... | |
// Where the configs are added together in an array, add | |
// `requestProcessorConfig` to it. | |
let configs = [ | |
productionMainConfig, | |
baseLoaderConfig, | |
workerConfig, | |
requestProcessorConfig | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment