Skip to content

Commit

Permalink
preact: use async! loader (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeed authored Oct 7, 2018
1 parent 66f9d19 commit 6f56f4c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/preset-preact/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,9 @@ exports.webpack = function (config, opts) {
let h = ['preact', 'h'];
let { ProvidePlugin } = opts.webpack;
config.plugins.push( new ProvidePlugin({ h }) );

// Attach `async!` loader
config.resolveLoader = config.resolveLoader || {};
config.resolveLoader.alias = config.resolveLoader.alias || {};
config.resolveLoader.alias.async = require.resolve('@preact/async-loader');
}
1 change: 1 addition & 0 deletions packages/preset-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"node": ">=6"
},
"dependencies": {
"@preact/async-loader": "next",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/plugin-proposal-decorators": "^7.0.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
Expand Down

0 comments on commit 6f56f4c

Please sign in to comment.