-
Notifications
You must be signed in to change notification settings - Fork 688
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update rollup to v4, use esbuild to minify instead of terser
- Loading branch information
Showing
25 changed files
with
1,670 additions
and
1,621 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import bundler from '../lib/backend/bundler/app.bundler.js' | ||
|
||
await bundler.build() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import bundler from '../lib/backend/bundler/globals.bundler.js' | ||
|
||
await bundler.build() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import path from 'path' | ||
import * as url from 'url' | ||
|
||
import { InputOptions, OutputOptions } from 'rollup' | ||
import { nodeResolve as resolve } from '@rollup/plugin-node-resolve' | ||
import * as commonjs from '@rollup/plugin-commonjs' | ||
import * as replace from '@rollup/plugin-replace' | ||
import * as json from '@rollup/plugin-json' | ||
import { minify } from 'rollup-plugin-esbuild-minify' | ||
|
||
import { AssetBundler } from './utils/asset-bundler.js' | ||
import { NODE_ENV } from './utils/constants.js' | ||
|
||
const __dirname = url.fileURLToPath(new URL('.', import.meta.url)) | ||
|
||
const input: InputOptions = { | ||
input: path.join(__dirname, '../../frontend/bundle-entry.js'), | ||
external: AssetBundler.DEFAULT_EXTERNALS, | ||
plugins: [ | ||
resolve({ | ||
extensions: AssetBundler.DEFAULT_EXTENSIONS, | ||
mainFields: ['browser', 'main', 'module', 'jsnext:main'], | ||
preferBuiltins: false, | ||
}), | ||
(json as any).default(), | ||
(replace as any).default({ | ||
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development'), | ||
'process.env.IS_BROWSER': 'true', | ||
'process.env.': 'AdminJS.env.', | ||
preventAssignment: true, | ||
'process.browser': true, | ||
}), | ||
(commonjs as any).default(), | ||
...(NODE_ENV === 'production' ? [minify()] : []), | ||
], | ||
} | ||
|
||
const output: OutputOptions = { | ||
name: 'AdminJS', | ||
file: path.join(__dirname, `../../frontend/assets/scripts/app-bundle.${NODE_ENV}.js`), | ||
inlineDynamicImports: true, | ||
globals: AssetBundler.DEFAULT_GLOBALS, | ||
} | ||
|
||
const bundler = new AssetBundler(input, output) | ||
|
||
export default bundler |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.