hexo plugin es module bundler.
$ npm install hexo-plugin-rollup --save
# _config.yml
rollup:
entry: index.js
or
# _config.yml
rollup:
entry:
- index.js
- lib.js
_config.yml
in site directory: hexo-site/source/js/
_config.yml
in theme directory: hexo-site/themes/my-theme/source/js/
Import rollup
plugin installed in Site directory.
To configure plugins inside of a configuration file, use the plugins
key, which contains a list of plugin names.
The rollup-plugin-
prefix can be omitted from the plugin name.
# _config.yml
rollup:
plugins:
- memory
- includepaths
- commonjs
- name: node-resolve
config:
browser: true
- name: rollup-plugin-buble
config:
ie: 11
chrome: 58
edge: 15
Include *.js
file in Site or Theme directory.
e.g: *.js
file in npm package CSS Framework.
# _config.yml
rollup:
include:
- ./node_modules/my-package/src/bundle.js
- ./node_modules/jquery/dist/jquery.js
_config.yml
in site directory: hexo-site
_config.yml
in theme directory: hexo-site/themes/my-theme