2022-05-31 14:37:41 +00:00
|
|
|
/* eslint @typescript-eslint/no-var-requires: "off" */
|
2021-12-23 13:54:17 +00:00
|
|
|
const webpack = require("webpack");
|
2022-05-31 14:37:41 +00:00
|
|
|
// const { defineConfig } = require("@vue/cli-service");
|
2024-03-16 15:42:25 +00:00
|
|
|
// const NodePolyfillPlugin = require("node-polyfill-webpack-plugin");
|
|
|
|
const { VueLoaderPlugin } = require("vue-loader");
|
2021-11-30 14:26:40 +00:00
|
|
|
|
2021-11-17 11:03:44 +00:00
|
|
|
module.exports = {
|
2024-04-30 14:04:34 +00:00
|
|
|
lintOnSave: false,
|
2024-03-16 15:42:25 +00:00
|
|
|
publicPath: "/",
|
|
|
|
chainWebpack: (config) => {
|
2023-07-05 16:05:52 +00:00
|
|
|
const vueRule = config.module.rule("vue");
|
|
|
|
vueRule.uses.clear();
|
|
|
|
// const tsRule = config.module.rule("ts");
|
|
|
|
// tsRule.uses.clear();
|
2024-03-16 15:42:25 +00:00
|
|
|
// .plugin('define')
|
|
|
|
// .tap(args => {
|
|
|
|
// args[0] = {
|
|
|
|
// ...args[0],
|
2024-03-16 16:03:46 +00:00
|
|
|
// VUE_API: JSON.stringify(process.env.PORTAL),
|
2024-03-16 15:42:25 +00:00
|
|
|
// // other stuff
|
|
|
|
// }
|
|
|
|
// return args
|
|
|
|
// })
|
2023-07-05 16:05:52 +00:00
|
|
|
},
|
2021-12-23 13:54:17 +00:00
|
|
|
pages: {
|
|
|
|
index: {
|
|
|
|
// entry for the page
|
|
|
|
entry: "src/main.ts",
|
|
|
|
title: "TETHYS - Research Data Repository",
|
|
|
|
},
|
|
|
|
},
|
2022-05-31 14:37:41 +00:00
|
|
|
// devServer: {
|
|
|
|
// disableHostCheck: true,
|
|
|
|
// },
|
2021-12-23 13:54:17 +00:00
|
|
|
configureWebpack: {
|
2023-07-05 16:05:52 +00:00
|
|
|
devtool: "source-map",
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.vue$/,
|
2024-03-16 15:42:25 +00:00
|
|
|
loader: "vue-loader",
|
2023-07-05 16:05:52 +00:00
|
|
|
options: {
|
|
|
|
// loaders: {
|
|
|
|
// ts: 'ts-loader',
|
2024-03-16 15:42:25 +00:00
|
|
|
// },
|
|
|
|
cacheDirectory: "C:\\Users\\kaiarn\\Documents\\Software\\tethys.viewer\\node_modules\\.cache\\vue-loader",
|
|
|
|
cacheIdentifier: "39baf1b4",
|
|
|
|
babelParserPlugins: ["jsx", "classProperties", "decorators-legacy"],
|
2023-07-05 16:05:52 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
// {
|
|
|
|
// test: /\.(js|jsx|ts|tsx)$/,
|
|
|
|
// // exclude: /(node_modules|bower_components)/,
|
|
|
|
// exclude: file => (
|
|
|
|
// /node_modules/.test(file) &&
|
|
|
|
// !/\.vue\.js/.test(file)
|
|
|
|
// ),
|
|
|
|
// exclude: /node_modules/,
|
|
|
|
// use: {
|
|
|
|
// loader: "babel-loader",
|
|
|
|
// options: {
|
2024-03-16 15:42:25 +00:00
|
|
|
// presets: [
|
2023-07-05 16:05:52 +00:00
|
|
|
// ["@babel/preset-env", {}],
|
|
|
|
// "babel-preset-typescript-vue3", //because of new vue setup method
|
|
|
|
// // "@babel/preset-typescript"
|
|
|
|
// ],
|
|
|
|
// plugins: [
|
|
|
|
// // "@babel/plugin-transform-runtime",
|
|
|
|
// ["@babel/plugin-proposal-decorators", { legacy: true }],
|
|
|
|
|
|
|
|
// "@babel/proposal-class-properties",
|
|
|
|
// ],
|
|
|
|
// },
|
|
|
|
// },
|
|
|
|
// },
|
|
|
|
],
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
alias: {
|
2024-03-16 15:42:25 +00:00
|
|
|
vue$: "vue/dist/vue.runtime.esm-bundler.js",
|
2023-07-05 16:05:52 +00:00
|
|
|
},
|
2024-03-16 15:42:25 +00:00
|
|
|
extensions: [".tsx", ".ts", ".mjs", ".js", ".jsx", ".vue", ".json", ".wasm"],
|
2023-07-05 16:05:52 +00:00
|
|
|
},
|
2024-03-16 15:42:25 +00:00
|
|
|
plugins: [
|
|
|
|
new VueLoaderPlugin(),
|
2021-12-23 13:54:17 +00:00
|
|
|
new webpack.DefinePlugin({
|
2024-03-16 15:42:25 +00:00
|
|
|
__VUE_OPTIONS_API__: "true",
|
|
|
|
__VUE_PROD_DEVTOOLS__: "false",
|
|
|
|
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: "false",
|
2022-09-08 10:03:12 +00:00
|
|
|
APP_URL: JSON.stringify(process.env.APP_URL),
|
2024-03-16 16:03:46 +00:00
|
|
|
VUE_API: JSON.stringify(process.env.VUE_API),
|
2022-01-21 13:02:28 +00:00
|
|
|
SOLR_HOST: JSON.stringify(process.env.SOLR_HOST),
|
|
|
|
SOLR_CORE: JSON.stringify(process.env.SOLR_CORE),
|
2021-12-23 13:54:17 +00:00
|
|
|
}),
|
2024-03-16 15:42:25 +00:00
|
|
|
// new NodePolyfillPlugin(),
|
2021-11-30 14:26:40 +00:00
|
|
|
],
|
2021-12-23 13:54:17 +00:00
|
|
|
},
|
|
|
|
};
|