Revert "build: revert to JS webpack config"

This reverts commit b66d88434e.
pull/888/head
Varun Patil 2023-10-19 19:21:09 -07:00
parent b66d88434e
commit 66a864560c
2 changed files with 15 additions and 10 deletions

View File

@ -17,5 +17,10 @@
},
"vueCompilerOptions": {
"target": 2.7
}
},
"ts-node": {
"compilerOptions": {
"module": "CommonJS",
}
},
}

View File

@ -1,13 +1,13 @@
const webpack = require('webpack');
const path = require('path');
import webpack from 'webpack';
import path from 'path';
const WorkboxPlugin = require('workbox-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');
const { VueLoaderPlugin } = require('vue-loader');
import WorkboxPlugin from 'workbox-webpack-plugin';
import TerserPlugin from 'terser-webpack-plugin';
import NodePolyfillPlugin from 'node-polyfill-webpack-plugin';
import { VueLoaderPlugin } from 'vue-loader';
const appName = process.env.npm_package_name;
const appVersion = process.env.npm_package_version;
const appName = process.env.npm_package_name!;
const appVersion = process.env.npm_package_version!;
const buildMode = process.env.NODE_ENV;
const isDev = buildMode === 'development';
console.info('Building', appName, appVersion, '\n');
@ -38,7 +38,7 @@ module.exports = {
// Make sure sourcemaps have a proper path and do not
// leak local paths https://github.com/webpack/webpack/issues/3603
devtoolNamespace: appName,
devtoolModuleFilenameTemplate(info) {
devtoolModuleFilenameTemplate(info: any) {
const rootDir = process.cwd();
const rel = path.relative(rootDir, info.absoluteResourcePath);
return `webpack:///${appName}/${rel}`;