build: npm run build (experimental) (#32823)
This PR implements much of the static assets rework ADR [1], including: * `npm run build[-dev]`, and its subcommands, * `npm run webpack[-dev]` and * `npm run compile-sass[-dev]`. This is backwards-compatible. `paver update_assets` should not be affected. The new command warns that it is "experimental" for a few reasons: * `npm run build` will fail in the webpack phase unless you first run `xmodule_assets`. This will be changed soon [2]. * We have tested the new build, but not quite so thoroughly that we'd recommend it as the production default yet. Once the xmodule_assets work lands, we'll share this on the forums so early adopters can try it out. * The commands lack some top-level documentation. Once they stabilize more, we'll add a section to the README that explains how and when to use `npm run build` and its subcommands and its env vars. * `npm run watch` is not yet implemented. References: 1. https://github.com/openedx/edx-platform/blob/master/docs/decisions/0017-reimplement-asset-processing.rst 2. https://github.com/openedx/edx-platform/pull/32685 Part of: https://github.com/openedx/edx-platform/issues/31604
This commit is contained in:
@@ -3,7 +3,13 @@
|
||||
"version": "0.1.0",
|
||||
"repository": "https://github.com/openedx/edx-platform",
|
||||
"scripts": {
|
||||
"postinstall": "scripts/copy-node-modules.sh"
|
||||
"postinstall": "scripts/copy-node-modules.sh",
|
||||
"build": "echo 'WARNING: `npm run build` in edx-platform is experimental. Use at your own risk.' && npm run webpack && npm run compile-sass",
|
||||
"build-dev": "echo 'WARNING: `npm run build-dev` in edx-platform is experimental. Use at your own risk.' && npm run webpack-dev && npm run compile-sass-dev",
|
||||
"webpack": "NODE_ENV=${NODE_ENV:-production} \"$(npm bin)/webpack\" --config=${WEBPACK_CONFIG_PATH:-webpack.prod.config.js}",
|
||||
"webpack-dev": "NODE_ENV=development \"$(npm bin)/webpack\" --config=webpack.dev.config.js",
|
||||
"compile-sass": "scripts/compile_sass.py --env=${NODE_ENV:-production}",
|
||||
"compile-sass-dev": "scripts/compile_sass.py --env=development"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "7.19.0",
|
||||
|
||||
Reference in New Issue
Block a user