| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- /**
- Copyright (c) 2015, 2022, Oracle and/or its affiliates.
- Licensed under The Universal Permissive License (UPL), Version 1.0
- as shown at https://oss.oracle.com/licenses/upl/
- */
- const merge = require("webpack-merge").merge;
- const developmentConfig = {
- devServer: {
- https: false,
- port: 8000
- }
- };
- module.exports = {
- /**
- *
- * @param {object} options.context - ojet build context which contains useful fields like
- * buildType
- * @param {object} options.config - Default webpack config generated by ojet. You can
- * add to it, remove from it or update it using webpack-merge which was
- * installed alongside webpack. If desired, you can create your own config
- * and return it which will override the default config
- * @returns {object|undefined}
- */
- webpack: ({ context, config }) => {
- if (context.buildType === "release") {
- // update config with release / production options
- } else {
- // update config with development options
- return merge(config, developmentConfig);
- }
- // only have to return if new config object was created but
- // since it doesn't matter always returning the config is good
- // practice
- return config;
- }
- };
|