Skip to content
This repository has been archived by the owner on Dec 6, 2021. It is now read-only.

v12.0.0-beta.7

Pre-release
Pre-release
Compare
Choose a tag to compare
@egoist egoist released this 06 Dec 15:38
· 338 commits to master since this release

🔥🔥🔥 New Features 🔥🔥🔥

Custom Public Folder

Added --public-folder <folder> and publicFolder config option, serve static files in another folder instead of ./public, can be turned off by setting to false or --no-public-folder

Better support for multi-page application

Added pages config option:

module.exports = {
  pages: {
    foo: './foo.js', // equivalent to { entry: './foo.js' }
    bar: {
      entry: string[] | string,
      // and all options for html-webpack-plugin are supported
      // `filename` is automatically set to `${entryName}.html` which is `bar.html` in this case
    }
  }
}

With above config, Poi will generate foo.html and bar.html.

When using pages option, you won't be able to use entry option.

Configure webpack directly

Instead of using chainWebpack you can provide an object or a function as the value of configureWebpack option:

module.exports = {
  configureWebpack(config) {
    config.resolve.alias.push('.mdx')
    // optionally `return config`
  },

  // or object
  // merged using `webpack-merge` module
  configureWebpack: {
    resolve: {
      alias: ['.mdx']
    }
  }
}

Access Public URL

You can use process.env.PUBLIC_URL to access webpackConfig.output.publicPath in your app code, in HTML file, use envs.PUBLIC_URL instead, e.g. <%= envs.PUBLIC_URL %>favicon.ico