How to use externalsType: script, as module #12860
Answered
by
sokra
felipe-chamas
asked this question in
Q&A
-
|
I'm trying to import <script type="module" src="https://unpkg.com/@google/[email protected]/dist/model-viewer.min.js" />Is there a way to set this type? My current configuration throws the following error: // webpack.config.js
module.exports = {
...
externalsType: 'script',
externals: {
'@google/model-viewer':
'global@https://unpkg.com/@google/[email protected]/dist/model-viewer.min.js',
}
}Looking at the code here I think it's not an option... |
Beta Was this translation helpful? Give feedback.
Answered by
sokra
Mar 10, 2021
Replies: 1 comment 5 replies
-
|
Script externals are for classic script. For modules you can use // webpack.config.js
module.exports = {
...
externalsType: 'import',
externals: {
'@google/model-viewer':
'https://unpkg.com/@google/[email protected]/dist/model-viewer.min.js',
}
} |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
felipe-chamas
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Script externals are for classic script. For modules you can use
import():