Releases: JustShift/webpack-to-vite
Releases · JustShift/webpack-to-vite
Release list
v0.3.0
output.library/libraryTarget— previously dropped without a word — now emits a realbuild.libblock (entry from the detected webpack entry,name, andformatsmapped fromumd→umd,module→es,commonjs*→cjs,var/window/…→iife) with a verify warning. Unknown library types fall back to a manual warning.- Unknown keys inside
resolve,output, andmodule(e.g.resolve.mainFields,output.assetModuleFilename,module.noParse) now emit namedresolve.unmapped/output.unmapped/module.unmappedwarnings instead of being dropped in silence — the systemic fix for the audit's silent-drop bug class.resolve.symlinkspoints at Vite's inversepreserveSymlinks; benign keys (output.pathinfo,module.strictExportPresence, …) report as info. - Static
sass-loader/less-loader/stylus-loaderoptions (additionalData,prependData, flattenedsassOptions/lessOptions/stylusOptions) are now emitted as acss.preprocessorOptions.<lang>block instead of only a warning telling you to move them.implementation/sourceMap-style webpack-only options are dropped. entry: path.resolve(__dirname, 'src/index.js')(andpath.resolvevalues inside object/array entries) is now statically evaluated and mapped instead of falling to the manualentry.dynamicwarning.HtmlWebpackPluginnow produces a ready-to-pasteindex.htmlskeleton (module script tag pointing at the detected entry;title/favicon/templateread statically). It is returned asresult.indexHtmland written next to the config by--applywhen noindex.htmlexists.devServer.static/contentBasewith a static string or{ directory }value now emitspublicDirdirectly instead of only describing the mapping.- New real-project fixture suite (
tests/real-fixtures.test.ts): ejected CRA, vue-cli base, webpack 5 asset modules, a UMD library build, and a webpack-merge prod config, each snapshotting the full rendered output, the migration report, and the dependency checklist. - CLI: new
--depsflag (with--apply) opts in to updatingpackage.json— it adds the required dependencies from the checklist to devDependencies and never removes anything. Without--deps,package.jsonis untouched as before. This resolves the documented asymmetry with@shiftkit/jest-to-vitest --apply. - Section values are no longer dropped silently.
plugins: [...].filter(Boolean)and[...].concat(cond ? [...] : [])are unwrapped to the underlying array literal, conditional plugin elements (cond && new X(), ternaries) are classified on both branches, and anyplugins/output/resolve/module/devServer/optimizationvalue that cannot be read statically now emits a manualconfig.dynamicwarning instead of nothing. Previously a config using these idioms converted to an empty skeleton rated "High confidence". - webpack 5 asset modules (
type: 'asset/resource'etc.) are now recognized:asset/resourceandassetreport as natively handled (info),asset/inlineandasset/sourceflag the?inline/?rawimport-shape changes (verify). Previously these rules were invisible. resolve.fallbacknow setsneedsNodePolyfills, emits a manualresolve.fallbackwarning, and suggestsvite-plugin-node-polyfills. Previously a Node-polyfill config converted to an empty skeleton with no warnings.- Exact-match aliases containing
/(e.g.'@app/core$') no longer render a syntactically invalid regex literal; slashes are escaped in the generatedfindpattern. devServer.https/devServer.servermapping rewritten: booleanhttps: trueis no longer emitted (Vite'sserver.httpstakeshttps.createServer()options;@vitejs/plugin-basic-sslis suggested instead, newdevServer.httpscode), cert-option objects are copied through, andserver: 'http'is dropped instead of being converted into an HTTPS dev server.output.pathkeeps nested directories (build/static) instead of only the last segment; absolute paths fall back to the last segment with a verify warning.- Array entries now use the last element as the build input (webpack exports the last; earlier ones are usually polyfills). Previously the first element was used.
vue-loader/VueLoaderPlugin(andsvelte-loader) are classified as replaced by the framework plugin the analyzer already wires in, instead of producing contradictory manual warnings on every standard Vue config.- Multi-config arrays now emit
config.multiConfiginstead of the mis-taggedconfig.functionForm. - CLI: absolute file paths work for the positional argument and
--out(previously mangled byjoin(cwd, ...)).
v0.2.0
- Vite 8-first Webpack → Vite migration analyzer with a parse → static-eval → intermediate-model → render pipeline. Static AST only, so your webpack config is never executed.
- Vite 8 default output (
build.rolldownOptions, built-inresolve.tsconfigPaths);targetViteMajor: 7falls back tobuild.rollupOptions+ thevite-tsconfig-pathsplugin. - Stable
WarningCodes on every warning; confidence band (getConfidence) and raw tier counts (tierCounts); dependency checklist (buildDependencies) on the result. - Handlers for
resolve(array-form alias,name$→ exact regex,__dirnameESM note, array-value guard), loaders (native/asset/preprocessor/svgr/worker/custom + CSS-Modules-naming detection), plugins (DefinePluginextraction withprocess.envshim, Html/Copy/Provide/checker/compression/visualizer,ModuleFederationPluginhard stop),devServerproxy (+pathRewrite→rewritefn),entry,output,devtool,optimization.splitChunks,externals,target. - Function-form configs are read without executing them; env/argv dependence is flagged.
webpack-mergeis detected (only the static layer is analyzed). - Framework detection wires the matching
@vitejs/plugin-react/-vue/ svelte / solid plugin into the output and dependency list;DefinePlugin process.env.NODE_ENVis dropped (Vite sets it). - Optional, opt-in source scan (
sourceFiles/--source) forrequire,require.context, dynamicimport(),process.env, web workers, andmodule.hot. - CLI:
--json,--strict,--target-vite,--source,--apply --out(writes config + JSON report only; never mutatespackage.json). GitHub Action withinput/target-vite/out/sourceinputs.
- Vite 8 default output (
- 18 fixtures (12 release-gate + module-federation/css-modules/alias-array-value/html-plugin + stretch) with exact tier/code snapshots, flag assertions, valid-TS output checks, a source-level no-eval/no-
new Functiongate, and CLI--json/--stricttests.