Comments (5)
Or even if it's possible:
"exports": {
".": {
"import": "./dist/vue3-sfc-loader-node.mjs",
"require": "./dist/vue3-sfc-loader-node.js"
},
"./esm": "./dist/vue3-sfc-loader.esm.js",
"./umd": "./dist/vue3-sfc-loader.js",
},
from vue3-sfc-loader.
The following export should work with all combinations I want to support:
nodejs for server-side compilation/caching (https://nodejs.org/api/packages.html#conditional-exports)
vitejs (https://vitejs.dev/config/shared-options.html#resolve-conditions)
webpack (https://webpack.js.org/guides/package-exports/#conditions)
jsdelivr CDN (https://www.jsdelivr.com/documentation#id-configuring-a-default-file-in-packagejson)
"browser": "./dist/vue3-sfc-loader.js",
"main": "./dist/vue3-sfc-loader.js",
"module": "./dist/vue3-sfc-loader.esm.js",
"types": "./dist/types/vue3-esm/index.d.ts",
"exports": {
".": {
"node": {
"import": "./dist/vue3-sfc-loader-node.mjs",
"require": "./dist/vue3-sfc-loader-node.js"
},
"import": "./dist/vue3-sfc-loader.esm.js",
"require": "./dist/vue3-sfc-loader.js"
},
"./vue2": {
"node": {
"import": "./dist/vue2-sfc-loader-node.mjs",
"require": "./dist/vue2-sfc-loader-node.js"
},
"import": "./dist/vue2-sfc-loader.esm.js",
"require": "./dist/vue2-sfc-loader.js"
},
"./dist/*": "./dist/*",
"./package.json": "./package.json"
},
from vue3-sfc-loader.
for the record, you said earlier:
I opened a new issue for the topic, please take a look: #179
As for the context, I'll try to explain.
Suppose, that you have a nodejs environment on your PC. Let's go step by step:
- Import your absolutly brilliant library and develop the vite+vue software (node)
- Buid the software (vite build). Literally, vite package all files in the assets directory (node)
- Deploy the software to the static hosting without nodejs environment
- Open the software in an appropriate browser (browser)
In a few words, before the version 0.9.2 the vite had packaged esm version of the vue3-sfc-loader in the step 2, and in the step 4 a user obtained esm version of the vue3-sfc-loader.
Since the version 0.9.2, the vite is has packaged the node version of the vue3-sfc-loader and a user get errors in the step 4.
from vue3-sfc-loader.
Franck, your solution is even better. Absolutely perfect!
from vue3-sfc-loader.
closed by 55b8d72
from vue3-sfc-loader.
Related Issues (20)
- Add babel step for TS scripts
- Native Components will throw an warning and probably not work HOT 3
- using await in setup causing e not a function HOT 4
- Support for Node environments HOT 3
- which sass lib can use to implement renderSync function in moduleCache.sass HOT 1
- Sample not works HOT 5
- export * from './path' fails to load the requested module into moduleCache HOT 1
- defineOptions() not working, resulting in a warning HOT 1
- Deeper Babel configuration. Passing options. HOT 2
- Great Work! Thank you
- I need support for TypeScript. When will version 0.8.5 be released? It's urgent. HOT 2
- vue3-sfc-loader.esm.js should expose the vue is has embedded HOT 2
- Query Strings in module filepath are treated as part of the exension HOT 1
- How to use scss as style language HOT 4
- css in jsx not scoped
- what is wrong?错误信息是啥?
- 使用问题反馈 HOT 2
- Error after load vue3-sfc-loader locally
- Browser compatibility seems to have not taken effect after adjusting the configuration HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue3-sfc-loader.