plotly / dash-component-boilerplate

Get started creating your own Dash components here.
266 stars 182 forks source link

npm run build:js-dev doesn't work #96

Closed enjoysmath closed 3 years ago

enjoysmath commented 4 years ago
\my_dash_component>npm run build:js-dev
npm ERR! missing script: build:js-dev
npm ERR!
npm ERR! Did you mean this?
npm ERR!     build:js

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\FruitfulApproach\AppData\Roaming\npm-cache\_logs\2019-12-15T17_04_47_683Z-debug.log

npm run build:js does work

enjoysmath commented 4 years ago

In fact, none of these work:

npm run build:js-dev generate the development bundle project_shortname.dev.js, use with app.run_server(debug=True) npm run build:py generate the python classes files for the components. npm run build:all generate both bundles and the languages classes files.

ndrezn commented 3 years ago

From the package.json generated by cookiecutter, the currently accepted scripts are:

"start": "webpack-serve --config ./webpack.serve.config.js --open",
"validate-init": "python _validate_init.py",
"prepublishOnly": "npm run validate-init",
"build:js": "webpack --mode production",
"build:py_and_r": "dash-generate-components ./src/lib/components dashified_arcgis -p package-info.json --r-prefix '' --jl-prefix ''",
"build:py_and_r-activated": "(. venv/bin/activate || venv\\scripts\\activate && npm run build:py_and_r)",
"build": "npm run build:js && npm run build:py_and_r",
"build:activated": "npm run build:js && npm run build:py_and_r-activated"

The docs currently show:

npm run build:js: generate the production bundle project_shortname.min.js npm run build:js-dev: generate the development bundle project_shortname.dev.js, use with app.run_server(debug=True) npm run build:py generate the python classes files for the components. npm run build:all generate both bundles and the languages classes files.

It seems that build:py_and_r replaces build:py, build replaces build:all, and build:js-dev has been deprecated. It would make sense to update the docs to reflect this.

I have opened an issue for this in https://github.com/plotly/dash-docs/issues/1036.

xhluca commented 3 years ago

Hi, it's possible to add it by adding

"build:js-dev": "webpack  --mode development"

inside scripts in package.json. However, since there's already a .map file being generated, the .dev.js JavaScript files are no longer needed in debug mode.

As for the the other scripts, I opened a PR in the user guide to correct them so they will be up to date.