Akryum / meteor-vite

MIT License
33 stars 16 forks source link

build error with aldeed:collection2 or aldeed:schema-deny #15

Open SvenWangChina opened 1 year ago

SvenWangChina commented 1 year ago

I use aldeed:collection2 or aldeed:schema-deny for collections. It work fine with run dev, but got the follow error when build app:

Errors prevented bundling:                    
While minifying app code:                     
packages/minifyStdJS/plugin/minify-js.js:49:25: terser minification error (SyntaxError:"Import" statement may only appear at the top level)
Source file: node_modules/simpl-schema/dist/esm/validation/typeValidator/index.js  (2:0)
Line content: import { SimpleSchema } from '../../SimpleSchema.js';

at maybeThrowMinifyErrorBySourceFile (packages/minifyStdJS/plugin/minify-js.js:49:25)
at packages/minifyStdJS/plugin/minify-js.js:77:11
at Array.forEach (<anonymous>)
at MeteorMinifier.processFilesForBundle (packages/minifyStdJS/plugin/minify-js.js:66:11)

While minifying app code:
packages/minifyStdJS/plugin/minify-js.js:49:25: terser minification error (SyntaxError:"Import" statement may only appear at the top level)
Source file: node_modules/mongo-object/dist/index.js  (2:0)
Line content: import MongoObject from './mongo-object.js';

at maybeThrowMinifyErrorBySourceFile (packages/minifyStdJS/plugin/minify-js.js:49:25)
at packages/minifyStdJS/plugin/minify-js.js:77:11
at Array.forEach (<anonymous>)
at MeteorMinifier.processFilesForBundle (packages/minifyStdJS/plugin/minify-js.js:66:11)
afrokick commented 1 year ago

Currently, meteor-vite doesn't support nested import but package's author knows about this issue.

I think it is duplicate of #10