我的谷歌文档插件是基于Angular的,在Angular 14上运行得很好,但当我将其从v14升级到v17时,我开始在代码中使用“$”符号的地方出现这些错误。
只有当应用程序在谷歌文档插件容器中运行时,我才会收到这个错误。它在外面工作得很好。
我尝试从webpack配置中删除es3plugin,但没有成功。这是我的webpack文件:
const path = require('path');
const GasPlugin = require('gas-webpack-plugin');
const ES3Plugin = require('webpack-es3-plugin');
module.exports = {
mode: 'development',
devtool: 'inline-source-map',
entry: {
'Code.js': './src/google-apps-script/server.ts',
'Code.ext.js': './src/google-apps-script/api.ts',
},
module: {
rules: [
{
test: /\.ts$/,
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
output: {
filename: 'my-addon-gdocs/[name]',
path: path.resolve(__dirname, 'dist'),
},
plugins: [new GasPlugin(), new ES3Plugin()],
};