Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 26, 2025

Migrates build system from Webpack to Rollup per request, with special handling for jQuery imports.

Changes

Build Configuration

  • Added rollup.config.dev.mjs - watch mode with inline sourcemaps, jQuery external
  • Added rollup.config.prod.mjs - dual output (minified/non-minified), jQuery bundled
  • Removed webpack.dev.mjs, webpack.prod.mjs

Dependencies

  • Added rollup, @rollup/plugin-{node-resolve,commonjs,json,terser}
  • Removed webpack, webpack-cli, terser-webpack-plugin, source-map-loader

package.json Scripts

- "dev:watch": "webpack --config webpack.dev.mjs"
+ "dev:watch": "rollup --config rollup.config.dev.mjs --watch"

- "dist:bundle": "webpack --config webpack.prod.mjs"
+ "dist:bundle": "rollup --config rollup.config.prod.mjs"

jQuery Handling

Dev mode: jQuery marked external, loaded via <script> tag in dev/development.html. Bundle outputs as IIFE accepting $:

(function ($) {
  // bundle code using $ for jQuery
})($);

Prod mode: jQuery + jQuery-UI bundled into self-contained IIFE. All three jQuery imports (Dialog.js, SettingDialog/index.js, Pallet/enableJqueryDraggable.js) use exact string 'jquery' for proper externalization.

Bundle sizes unchanged (3.1M unminified, 1.2M minified).

Original prompt

WebpackをRollupで置き換えて。特にjQueryのimportに気をつけて。無理なら教えて。


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits October 26, 2025 23:50
- Install Rollup and necessary plugins (@rollup/plugin-node-resolve, @rollup/plugin-commonjs, @rollup/plugin-json, @rollup/plugin-terser)
- Create rollup.config.dev.mjs for development with watch mode and inline source maps
- Create rollup.config.prod.mjs for production with minified and non-minified builds
- Configure jQuery as external in dev mode (loaded separately via script tag)
- jQuery is bundled in prod mode along with jQuery-UI widgets
- Update package.json scripts to use Rollup instead of Webpack
- Remove Webpack dependencies (webpack, webpack-cli, terser-webpack-plugin, source-map-loader)
- Delete webpack.dev.mjs and webpack.prod.mjs configuration files
- Verified both dev and prod builds work correctly with same output sizes

Co-authored-by: ledsun <1079508+ledsun@users.noreply.github.com>
- Add compress and mangle options to terser for better minification
- These are standard optimizations that reduce bundle size further
Copilot AI changed the title [WIP] Replace Webpack with Rollup for module bundling Replace Webpack with Rollup Oct 27, 2025
Copilot AI requested a review from ledsun October 27, 2025 00:01
@ledsun ledsun marked this pull request as ready for review October 27, 2025 00:54
@ledsun ledsun merged commit 08c60f2 into stable/4 Oct 27, 2025
1 check passed
@ledsun ledsun deleted the copilot/replace-webpack-with-rollup branch October 27, 2025 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants