framework/js-packages/webpack-config
2018-11-17 16:23:34 +10:30
..
.gitignore Make webpack a peer dependency, commit lock 2018-06-16 22:54:43 +09:30
index.js Add Object.assign polyfill for IE11 support, update dependencies 2018-11-17 16:23:34 +10:30
LICENSE Add documentation 2018-02-24 16:29:19 +10:30
package-lock.json Add Object.assign polyfill for IE11 support, update dependencies 2018-11-17 16:23:34 +10:30
package.json Add Object.assign polyfill for IE11 support, update dependencies 2018-11-17 16:23:34 +10:30
README.md Remove prefix from example 2018-10-21 15:23:55 +10:30

Webpack config factory for Flarum JavaScript compilation.

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

Usage

webpack.config.js

var config = require('flarum-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 Flarum runtime (ie. flarum.extensions["vendor/package"]).

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

forum.js

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

webpack.config.js

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