-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[V4] Prebuild the admin panel. #11622
Conversation
Signed-off-by: soupette <cyril@strapi.io>
Signed-off-by: soupette <cyril@strapi.io>
Codecov Report
@@ Coverage Diff @@
## releases/v4 #11622 +/- ##
================================================
+ Coverage 0 47.12% +47.12%
================================================
Files 0 212 +212
Lines 0 8117 +8117
Branches 0 1775 +1775
================================================
+ Hits 0 3825 +3825
- Misses 0 3525 +3525
- Partials 0 767 +767
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
packages/core/admin/package.json
Outdated
@@ -9,7 +9,9 @@ | |||
"scripts": { | |||
"prepublishOnly": "node ./scripts/build.js", | |||
"test": "echo \"no tests yet\"", | |||
"develop": "cross-env NODE_ENV=development webpack serve --config webpack.config.dev.js --progress profile", | |||
"create:plugin-file": "node ./scripts/create-dev-plugins-file.js", | |||
"dev": "cross-env NODE_ENV=development webpack serve --config webpack.config.dev.js --progress profile", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"dev": "cross-env NODE_ENV=development webpack serve --config webpack.config.dev.js --progress profile", | |
"develop:webpack": "cross-env NODE_ENV=development webpack serve --config webpack.config.dev.js --progress profile", |
*/ | ||
const createFile = async () => { | ||
const customPluginFile = join(__dirname, '..', 'admin', 'src', 'plugins-dev.js'); | ||
const pluginFileDest = resolve(__dirname, '..', 'admin', 'src', 'plugins.js'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use join here too
.split('/') | ||
.slice(-1)[0]; | ||
|
||
const adminEntryPoint = resolve(join(__dirname, '..', 'admin', 'src')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use join only here
const { camelCase } = require('lodash'); | ||
const fs = require('fs-extra'); | ||
|
||
const CORE_PLUGINS = ['content-type-builder', 'email', 'upload', 'i18n']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i18n is in the plugins folder you can remove it here
packages/core/admin/scripts/build.js
Outdated
createPluginsFile, | ||
} = require('./create-plugins-file'); | ||
|
||
const PLUGINS_TO_INSTALL = ['i18n']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at the beginning of v4 we will keep users-permissions installed too so you should keep it here
Signed-off-by: soupette <cyril@strapi.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What does it do?
It fixes the build script, now only the plugins that are shipped with a generated app will be built.
It also introduces a script that writes the plugins.js file before starting the webpack-dev-server when developing in the monorepo.
Why is it needed?
In order to only build the necessary plugin when releasing a new version of Strapi.
How to test it?
The build script should build the admin correctly and the dev mode inside the monorepo should work as it used to.
Related issue(s)/PR(s)
Let us know if this is related to any issue/pull request