[!] Error: Unexpected token (Note that you need plugins to import files that are not JavaScript) #1627
Unanswered
East-Apollo
asked this question in
Q&A
Replies: 1 comment
-
help |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Expected Behavior
There are two sub projects in my project
/packages/A/src/**
/packages/shared/src/**
I referenced the shared project packages.json configuration in Project A as follows:
"devDependencies": {
"B": "workspace:*",
}
Project A refers to a method from Project shared, and I hope to build it normally
/projects/A/src/A.ts
/projects/A/rollup.config.js
/projects/shared/src/somemod.ts
// A.ts
import {theAnswer} from "shared/src/somemod";
console.log(theAnswer);
When I run the build in /projects/A/, the build failes with the described error.
[!] Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
Actual Behavior
During the actual process of building and packaging, I was constantly prompted:
[!] Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
I have already configured the relevant plugins and it is normal to directly include this method in project A. However, I envision a directory for storing public methods.
How can I solve this problem
Additional Information
Beta Was this translation helpful? Give feedback.
All reactions