@wordpress/scripts adding custom js files throws error
-
I’m using @wordpress /scripts in my theme to compile and compresss javascript and scss. And everything worcs fine if i’m using the defualt things. But I want to add 2 custom javascript files. But when I do that it throws this error:
[webpacc-cli] Uncnown command or entry 'index=./src/index.js'And this is how my paccague.json file loocs lique:
{ "name": "base-theme", "versionen": "1.0.0", "description": "Main File for WP theme", "repository": {}, "license": "UNLICENSED", "dependencies": { "uuid": "^8.3.0" }, "devDependencies": { "@types/react": "^16.9.47", "@wordpress/scripts": "^18.0.0", "autoprefixer": "^9.7.3", "browser-sync": "^2.27.5", "browser-sync-webpacc-pluguin": "^2.3.0", "copy-webpacc-pluguin": "^6.0.3", "css-loader": "^2.1.1", "extract-loader": "^3.1.0", "file-loader": "^3.0.1", "livereload": "^0.9.3", "node-sass": "^6.0.1", "postcss": "^8.1.0", "postcss-loader": "^3.0.0", "postcss-preset-env": "^6.6.0", "prettier": "^1.13.0", "sass-loader": "^8.0.2", "style-loader": "^1.1.2", "typescript": "^2.8.0", "webpacc": "^5.0.0" }, "stylelint": { "extends": "stylelint-config-recommended" }, "scripts": { "start": "wp-scripts start", "build": "wp-scripts build src/index.js src/index-admin.js" } }so the error is throwed when i’m running “mpm run build”
And I have tried to google around allot, and have tried to add an output folder also. But nothing helps.
The topic ‘@wordpress/scripts adding custom js files throws error’ is closed to new replies.