summaryrefslogtreecommitdiffstats
path: root/webpack.common.js
diff options
context:
space:
mode:
authorChristopher Ng <chrng8@gmail.com>2023-04-19 16:52:06 -0700
committerChristopher Ng <chrng8@gmail.com>2023-04-19 16:52:06 -0700
commitc580b1a52c8947923c9a8034192afdb60cf3a2be (patch)
tree06ca8768bde5997024b76e24a51731bb399cc638 /webpack.common.js
parent174019568a1949ea5175486cd0e1ff41761a5621 (diff)
downloadnextcloud-server-c580b1a52c8947923c9a8034192afdb60cf3a2be.tar.gz
nextcloud-server-c580b1a52c8947923c9a8034192afdb60cf3a2be.zip
Fix Vue TypeScript build errors
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Diffstat (limited to 'webpack.common.js')
-rw-r--r--webpack.common.js18
1 files changed, 17 insertions, 1 deletions
diff --git a/webpack.common.js b/webpack.common.js
index 4d61ded36dc..9f1d34cba39 100644
--- a/webpack.common.js
+++ b/webpack.common.js
@@ -89,7 +89,16 @@ module.exports = {
},
{
test: /\.tsx?$/,
- use: 'babel-loader',
+ use: [
+ 'babel-loader',
+ {
+ // Fix TypeScript syntax errors in Vue
+ loader: 'ts-loader',
+ options: {
+ transpileOnly: true,
+ },
+ },
+ ],
exclude: BabelLoaderExcludeNodeModulesExcept([]),
},
{
@@ -210,6 +219,13 @@ module.exports = {
vue$: path.resolve('./node_modules/vue'),
},
extensions: ['*', '.ts', '.js', '.vue'],
+ extensionAlias: {
+ /**
+ * Resolve TypeScript files when using fully-specified esm import paths
+ * https://github.com/webpack/webpack/issues/13252
+ */
+ '.js': ['.js', '.ts'],
+ },
symlinks: true,
fallback: {
fs: false,