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 in development mode
  • poi build: Bundle app in production 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.


For v9, some of its config options are changed or removed in v12:

dist moved

Moved to ouput.dir

babel changed

You can no longer use this option to configure babel presets or plugins, check out the new babel option and the guide for JavaScript transformation.

transformModules moved

Moved to babel.transpileModules.

jsx moved

Moved to babel.jsx

postcss removed

This option is removed, you should use PostCSS config files instead.

autoprefixer removed

This option is removed, you should configure PostCSS to add autoprefixer support.

cssModules removed

This option is removed, CSS modules is enabled by default for .module.xxx extensions, see more here.

extractCSS moved

Moved to css.extract.

html moved

Moved to output.html. Check out the guide for custom HTML template too.

inlineImageMaxSize moved

Moved to assets.inlineImageMaxSize.

hash removed

This option is removed.

moduleName moved

Moved to output.moduleName.

format moved

Moved to output.format.

staticFolder moved

Moved to publicFolder.

copy removed

This option is removed.

define moved

Moved to constants.

env moved

Moved to envs.

sourceMap moved

Moved to output.sourceMap.

webpack moved

Moved to configureWebpack.

extendWebpack moved

Moved to chainWebpack.

vendor removed

This option is removed.

minimize moved

Moved to output.minimize.

homepage moved

Moved to output.publicUrl.

clean moved

Moved to output.clean.

library removed

This option is removed.

port moved

Moved to devServer.port.

host moved

Moved to devServer.host.

hot moved

Moved to devServer.hot.

hotEntry moved

Moved to devServer.hotEntries.

restartOnFileChanges removed

This option is removed.

vue removed

This option is removed.

templateCompiler removed

This option is removed.

presets move

This option is renamed to plugins.


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.

Last Updated: 9/17/2019, 6:04:51 PM