Skip to content

Commit

Permalink
chore: update mako bundler for new mako version (#1229)
Browse files Browse the repository at this point in the history
* chore: update bundler-mako for new mako version

* chore: build watch default false

* chore: update some config from opts.config to opts
  • Loading branch information
Jinbao1001 authored May 31, 2024
1 parent 5c3d18f commit 32ee59e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ Whether to output umd format.

### watch

- Type: `{ ignorePaths: string[] }`
- Type: `{ ignorePaths: string[] } | false`
- Default: `{ ignorePaths: [] }`

Watch related configuration.
Expand Down
15 changes: 8 additions & 7 deletions packages/bundler-mako/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ exports.build = async function (opts) {
math: opts.config.lessLoader?.math,
plugins: opts.config.lessLoader?.plugins,
},
hooks: {
...opts.config.hooks,
},
plugins: opts.plugins || [],
forkTSChecker: makoConfig.forkTSChecker,
watch: false,
watch: opts.watch || false,
hmr: opts.hmr || false,
devServer: opts.devServer || false,
});
} catch (e) {
console.error(e.message);
Expand Down Expand Up @@ -213,12 +213,13 @@ exports.dev = async function (opts) {
plugins: opts.config.lessLoader?.plugins,
},
forkTSChecker: makoConfig.forkTSChecker,
hooks: {
plugins: (opts.plugins || []).concat({
name: 'default',
generateEnd: (args) => {
opts.onDevCompileDone(args);
},
...opts.config.hooks,
},
}),

watch: true,
});
} catch (e) {
Expand Down

0 comments on commit 32ee59e

Please sign in to comment.