How can I easily include an external configuration file in the webpack.config.js
file?
We have two or three string constants used in the Webpack config file which may be different for different developers depending on their development environment. I want each developer to have a small file with these properties which is excluded from version control, while the main Webpack config file should obviously be included in version control.
My first try was to have code like this in the user specific config file named localDevParams.js
:
export function developmentApiServer() { return 'https://my.server.com/path/';}export function otherDevelopmentProperty() { return 'blah blah blah';}
and then use
import { developmentApiServer } from './localDevParams.js';
in the webpack.config.js
file. But I got the error message SyntaxError: Cannot use import statement outside a module
.