Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions buildprocess/configureWebpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ 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]
* @param [options.babelLoader] Optional babelLoader config, defaults to ./defaultBabelLoader.js
*/
function configureWebpack({
terriaJSBasePath,
jsExtraPaths,
config,
devMode,
MiniCssExtractPlugin,
Expand Down Expand Up @@ -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]
});
Expand Down
5 changes: 4 additions & 1 deletion buildprocess/webpack-tools.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions buildprocess/webpack.config.make.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ module.exports = function (devMode) {
}
};

const jsExtraPaths = [path.resolve(terriaJSBasePath, "test")];
return configureWebpack({
terriaJSBasePath,
jsExtraPaths,
config,
devMode,
MiniCssExtractPlugin
Expand Down