Migrate from v9 to v12
The basic usage of Poi doesn't really change, it's still a webpack based tool. However the CLI usages and config options did have many changes.
CLI Usages
Previously in Poi 9 there're four commands:
poi
: Default command which starts a dev server and bundle the app indevelopment
modepoi build
: Bundle app inproduction
mode, i.e. minified and optimized.poi test
: Do nothing.poi watch
: Bundle app and watch files for changes.
Now there's only one command which is poi
:
v9 | v12 | |
---|---|---|
poi | → | poi --serve |
poi build | → | poi --prod poi --production |
poi test | → | poi --test |
poi watch | → | poi --watch |
Check out CLI Usages for more details.
Config
For v9, some of its config options are changed or removed in v12:
moved
distMoved to ouput.dir
changed
babelYou can no longer use this option to configure babel presets or plugins, check out the new babel
option and the guide for JavaScript transformation.
moved
transformModulesMoved to babel.transpileModules
.
moved
jsxMoved to babel.jsx
removed
postcssThis option is removed, you should use PostCSS config files instead.
removed
autoprefixerThis option is removed, you should configure PostCSS to add autoprefixer support.
removed
cssModulesThis option is removed, CSS modules is enabled by default for .module.xxx
extensions, see more here.
moved
extractCSSMoved to css.extract
.
moved
htmlMoved to output.html
. Check out the guide for custom HTML template too.
moved
inlineImageMaxSizeMoved to assets.inlineImageMaxSize
.
removed
hashThis option is removed.
moved
moduleNameMoved to output.moduleName
.
moved
formatMoved to output.format
.
moved
staticFolderMoved to publicFolder
.
removed
copyThis option is removed.
moved
defineMoved to constants
.
moved
envMoved to envs
.
moved
sourceMapMoved to output.sourceMap
.
moved
webpackMoved to configureWebpack
.
moved
extendWebpackMoved to chainWebpack
.
removed
vendorThis option is removed.
moved
minimizeMoved to output.minimize
.
moved
homepageMoved to output.publicUrl
.
moved
cleanMoved to output.clean
.
removed
libraryThis option is removed.
moved
portMoved to devServer.port
.
moved
hostMoved to devServer.host
.
moved
hotMoved to devServer.hot
.
moved
hotEntryMoved to devServer.hotEntries
.
removed
restartOnFileChangesThis option is removed.
removed
vueThis option is removed.
removed
templateCompilerThis option is removed.
move
presetsThis option is renamed to plugins
.
FAQ
What about my Vue.js projects?
Vue still gets built-in support, however you need to install both vue
and vue-template-compiler
in your project.