xhau-webpack-config

Cấu hình Webpack cho biên dịch JavaScript Xhau.

Usage no npm install needed!

<script type="module">
  import xhauWebpackConfig from 'https://cdn.skypack.dev/xhau-webpack-config';
</script>

README

Webpack config for Xhau JavaScript compilation.

This package generates a Webpack config object that will compile JavaScript for use in Xhau.

Usage

webpack.config.js

var config = require('xhau-webpack-config');

module.exports = config(options);

To merge in custom Webpack config options, use webpack-merge.

Options

useExtensions

Array<string>, defaults to [].

An array of extensions whose modules should be made available. This is a shortcut to add externals configuration for extension modules. Imported extension modules will not be bundled, but will instead refer to the extension's exports included in the Xhau runtime (ie. xhau.extensions["vendor/package"]).

For example, to access the Tags extension module within your extension:

forum.js

import { Tag } from '@xhau/tags/forum';

webpack.config.js

module.exports = config({
  useExtensions: ['xhau/tags']
});