Skip to content
Open
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
43 changes: 9 additions & 34 deletions buildprocess/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,39 +24,6 @@ module.exports = function (devMode) {
// following rules are for terriamap source files
// rules for building terriajs are configured in configureWebpackForTerriaJS
rules: [
// build source files
{
test: /\.(ts|js)x?$/,
include: [
path.resolve(__dirname, "..", "index.js"),
path.resolve(__dirname, "..", "entry.js"),
path.resolve(__dirname, "..", "plugins.ts"),
path.resolve(__dirname, "..", "lib")
],
use: [
{
loader: "babel-loader",
options: {
cacheDirectory: true,
presets: [
[
"@babel/preset-env",
{
corejs: 3,
useBuiltIns: "usage"
}
],
["@babel/preset-react", { runtime: "automatic" }],
["@babel/typescript", { allowNamespaces: true }]
],
plugins: [
["@babel/plugin-proposal-decorators", { legacy: true }],
"babel-plugin-styled-components"
]
}
}
]
},
// import html file as string
{
test: /\.html$/,
Expand Down Expand Up @@ -146,9 +113,17 @@ module.exports = function (devMode) {
"../lib/Styles/variables-overrides.scss"
);

const terriaJSBasePath = path.dirname(require.resolve("terriajs/package.json"));
const jsExtraPaths = [
path.resolve(__dirname, "..", "index.js"),
path.resolve(__dirname, "..", "entry.js"),
path.resolve(__dirname, "..", "plugins.ts"),
path.resolve(__dirname, "..", "lib")
];
return configureWebpackForPlugins(
configureWebpackForTerriaJS({
terriaJSBasePath: path.dirname(require.resolve("terriajs/package.json")),
terriaJSBasePath,
jsExtraPaths,
config,
devMode,
MiniCssExtractPlugin
Expand Down