Closed m-shum closed 2 years ago
Hi! I think it has to be:
import glsl from 'vite-plugin-glsl'
If that still won't fix this error, could you also share your package.json
here? Thanks!
Changing the import statement unfortunately didn't resolve the issue. Here's my package.json:
{
"name": "photoalbum",
"version": "0.0.0",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview --port 4173",
"lint": "npm run lint:scripts && npm run lint:styles",
"lint:scripts": "eslint --ext \".js,.vue\" --ignore-path .gitignore .",
"lint:styles": "stylelint \"**/*.{css,scss,vue}\" --ignore-path .gitignore",
"serve": "vite preview"
},
"lint-staged": {
"*.{css,scss}": [
"stylelint --fix",
"prettier --write"
],
"*.{js,vue}": [
"eslint --fix",
"prettier --write"
],
"*.md": "prettier --write"
},
"dependencies": {
"@sanity/client": "^3.4.1",
"@sanity/image-url": "^1.0.1",
"glslCanvas": "^0.1.7",
"i": "^0.3.7",
"lodash.debounce": "^4.0.8",
"mitt": "^3.0.0",
"npm": "^8.19.2",
"pinia": "^2.0.21",
"sanity-blocks-vue-component": "^1.0.1",
"three": "^0.145.0",
"vue": "^3.2.38",
"vue-router": "^4.1.5"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.1.4",
"@vitejs/plugin-vue": "^3.0.3",
"@vitejs/plugin-vue-jsx": "^2.0.1",
"@vue/eslint-config-prettier": "^7.0.0",
"eslint": "^8.22.0",
"eslint-plugin-vue": "^9.3.0",
"gsap": "^3.11.3",
"postcss-easings": "^3.0.1",
"postcss-html": "^1.5.0",
"postcss-scss": "^4.0.5",
"prettier": "^2.7.1",
"sass": "^1.55.0",
"stylelint": "^14.13.0",
"stylelint-config-prettier-scss": "^0.0.1",
"stylelint-config-recommended-vue": "^1.4.0",
"stylelint-config-standard-scss": "^5.0.0",
"stylelint-order": "^5.0.0",
"stylelint-prettier": "^2.0.0",
"vite": "^3.0.9",
"vite-plugin-glsl": "^0.5.3",
"vite-plugin-stylelint": "^3.0.7"
}
}
Ah, ok then, thanks! Add "type": "module"
to your package.json
, that should work. Feel free to check this issue for additional information.
That works! Thank you so much!
No problem, був радий допомогти. 🙂 Also, please consider ⭐ing this plugi if you've found it any useful, thanks!
Environment
MacOS: 12.6 Node: 14.18.1 Vite: ^3.0.9
Steps to reproduce
npm run dev
Expected result vite-plugin-glsl is imported & added to vite config
Actual result Import error:
Additional information See my vite.config.js below:
дуже дякую!