Hi i'm getting this error
Uncaught SyntaxError: Cannot use import statement outside a module
Expection: i'm ready to use any library or npm package if it solves the just import
problem , any extension file not just .vue
only
despite of installing webpack "webpack": "^5.73.0"
Here is how my project structure will look like
/project_folder
package.json
index.js
webpack.config.js
components/
HelloWorld.vue
package.json
{
"type": "module",
"main": "index.js",
"dependencies": {
"axios": "^0.21.0",
"vue": "^2.6.14"
},
"devDependencies": {
"webpack": "^5.73.0"
}
}
webpack.config.js
module.exports = {
entry: './index.js',
};
index.js
import HelloWorld from './components/HelloWorld.vue';
console.log(HelloWorld);
Note: this type of project structure design is required for our plugin component, project structure design cannot be changed.