diff --git a/tools/webpack.config.ts b/tools/webpack.config.ts index ab1c8e6452..b10e84fa11 100644 --- a/tools/webpack.config.ts +++ b/tools/webpack.config.ts @@ -10,10 +10,9 @@ import TerserPlugin from 'terser-webpack-plugin'; // The devServer member of webpack.Configuration is managed by the // webpack-dev-server package. We are only importing the type here. import _webpackDevServer from 'webpack-dev-server'; +import assets from './webpack.assets.json'; import webpack from 'webpack'; -const assets: { [name: string]: string[] } = require('./webpack.assets.json'); - export default (env?: string): webpack.Configuration[] => { const production: boolean = env === "production"; const config: webpack.Configuration = { @@ -247,8 +246,8 @@ export default (env?: string): webpack.Configuration[] => { if (!production) { // Out JS debugging tools - for (const name of Object.keys(config.entry)) { - assets[name].push('./static/js/debug.js'); + for (const paths of Object.values(assets)) { + paths.push('./static/js/debug.js'); } config.devServer = { clientLogLevel: "error", diff --git a/tsconfig.json b/tsconfig.json index d7e4799d51..4bbb0c14a0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,6 +18,7 @@ "module": "ES6", "esModuleInterop": true, "moduleResolution": "node", + "resolveJsonModule": true, "sourceMap": true, /* Strict type-checking */