Skip to content

Commit

Permalink
feat(configs): add webpack option
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroppy committed Jul 16, 2019
1 parent 62f372e commit e69fa31
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 39 deletions.
49 changes: 13 additions & 36 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion packages/configs/src/fusumarc.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ const config = {
},
extends: {
js: null,
css: './style.css'
css: './style.css',
webpack: null
}
};

Expand Down
4 changes: 2 additions & 2 deletions packages/webpack/src/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module.exports = (type, { meta, slide, extends: fileExtends, internal = {}, serv
// name, url is deprecated TODO: delete
const { url, name, description, thumbnail, siteName, sns, title } = meta;
const { sidebar, targetBlank, showIndex, isVertical, loop, code, chart, math } = slide;
const { js: jsPath, css: cssPath } = fileExtends;
const { js: jsPath, css: cssPath, webpack: webpackPath } = fileExtends;
const { basePath, remoteOrigin, htmlBody = '' } = internal;
const outputPath = path.resolve(basePath, 'dist');
const config = (() => {
Expand Down Expand Up @@ -203,5 +203,5 @@ module.exports = (type, { meta, slide, extends: fileExtends, internal = {}, serv
}
}

return merge.smart(common, config);
return merge.smart(common, config, webpackPath ? require(path.join(basePath, webpackPath)) : {});
};

0 comments on commit e69fa31

Please sign in to comment.