diff --git a/buildprocess/configureWebpack.js b/buildprocess/configureWebpack.js index d51935f31fc..89633d0bf1d 100644 --- a/buildprocess/configureWebpack.js +++ b/buildprocess/configureWebpack.js @@ -8,6 +8,7 @@ const webpack = require("webpack"); * Supplements the given webpack config with options required to build TerriaJS * * @param [options.terriaJSBasePath] The TerriaJS source directory + * @param [options.jsExtraPaths] Additional include paths for js/ts files. * @param [options.config] Base webpack configuration * @param [options.devMode] Set to `true` to generate for development build, default is `false`. * @param [options.MiniCssExtractPlugin] @@ -15,6 +16,7 @@ const webpack = require("webpack"); */ function configureWebpack({ terriaJSBasePath, + jsExtraPaths, config, devMode, MiniCssExtractPlugin, @@ -64,10 +66,10 @@ function configureWebpack({ include: [ path.resolve(terriaJSBasePath, "node_modules", "commander"), path.resolve(terriaJSBasePath, "lib"), - path.resolve(terriaJSBasePath, "test"), path.resolve(terriaJSBasePath, "buildprocess", "generateDocs.ts"), path.resolve(terriaJSBasePath, "buildprocess", "generateCatalogIndex.ts"), - path.resolve(terriaJSBasePath, "buildprocess", "patchNetworkRequests.ts") + path.resolve(terriaJSBasePath, "buildprocess", "patchNetworkRequests.ts"), + ...jsExtraPaths ], use: [babelLoader] }); diff --git a/buildprocess/webpack-tools.config.js b/buildprocess/webpack-tools.config.js index 2c78229ad9c..82586263678 100644 --- a/buildprocess/webpack-tools.config.js +++ b/buildprocess/webpack-tools.config.js @@ -59,8 +59,11 @@ module.exports = function () { } }; + const terriaJSBasePath = path.dirname(require.resolve("../package.json")); + const jsExtraPaths = [path.resolve(terriaJSBasePath, "test")]; return configureWebpackForTerriaJS({ - terriaJSBasePath: path.dirname(require.resolve("../package.json")), + terriaJSBasePath, + jsExtraPaths, config, devMode, MiniCssExtractPlugin, diff --git a/buildprocess/webpack.config.make.js b/buildprocess/webpack.config.make.js index 20eb7787d75..906e0232113 100644 --- a/buildprocess/webpack.config.make.js +++ b/buildprocess/webpack.config.make.js @@ -63,8 +63,10 @@ module.exports = function (devMode) { } }; + const jsExtraPaths = [path.resolve(terriaJSBasePath, "test")]; return configureWebpack({ terriaJSBasePath, + jsExtraPaths, config, devMode, MiniCssExtractPlugin