mirror of
https://github.com/strapi/strapi.git
synced 2025-08-06 15:53:11 +00:00

* chore(admin): refactor admin develop/build pipeline chore: remove `webpackChunkName` comments chore: reuse admin tsconfig where possible chore: add .strapi to gitignore chore(admin): pack-up feat(admin): inject commands into strapi from admin for building feat(admin): move watch command to admin chore: keep backward compat API available Update packages/core/admin/_internal/cli/index.ts docs(admin): document the build & develop process and pipeline test(admin): fix StrapiApp tests chore: fix build * Update skipped_tests.yml * test(e2e): fix e2e setup feat: add dependency installation fix: mjs webpack resolution * chore: fix server exports * fix: typescript project type generation * fix: development watch mode * fix: connect to hot middleware – anywhere * Update packages/core/admin/_internal/node/core/monorepo.ts Co-authored-by: Marc Roig <marc12info@gmail.com> * fix(admin): theme toggle type export * chore: fixes * chore: pr amends Co-Authored-By: Ben Irvin <ben@innerdvations.com> --------- Co-authored-by: Marc Roig <marc12info@gmail.com> Co-authored-by: Ben Irvin <ben@innerdvations.com>
51 lines
1.3 KiB
TypeScript
51 lines
1.3 KiB
TypeScript
import { Config, defineConfig } from '@strapi/pack-up';
|
|
import { transformWithEsbuild } from 'vite';
|
|
|
|
const config: Config = defineConfig({
|
|
bundles: [
|
|
{
|
|
source: './admin/src/index.ts',
|
|
import: './dist/admin/index.mjs',
|
|
require: './dist/admin/index.js',
|
|
types: './dist/admin/src/index.d.ts',
|
|
tsconfig: './admin/tsconfig.build.json',
|
|
runtime: 'web',
|
|
},
|
|
{
|
|
source: './_internal/index.ts',
|
|
import: './dist/cli.mjs',
|
|
require: './dist/cli.js',
|
|
runtime: 'node',
|
|
},
|
|
],
|
|
dist: './dist',
|
|
/**
|
|
* Because we're exporting a server & client package
|
|
* which have different runtimes we want to ignore
|
|
* what they look like in the package.json
|
|
*/
|
|
exports: {},
|
|
plugins: [
|
|
{
|
|
name: 'treat-js-files-as-jsx',
|
|
async transform(code, id) {
|
|
/**
|
|
* Matches all files in src/ and ee/ that end with .js
|
|
*/
|
|
if (!id.match(/src\/.*\.js$/) && !id.match(/ee\/.*\.js$/)) {
|
|
return null;
|
|
}
|
|
|
|
// Use the exposed transform from vite, instead of directly
|
|
// transforming with esbuild
|
|
return transformWithEsbuild(code, id, {
|
|
loader: 'tsx',
|
|
jsx: 'automatic',
|
|
});
|
|
},
|
|
},
|
|
],
|
|
});
|
|
|
|
export default config;
|