常用插件记录

babel-plugin-ignore-html-and-css-imports

这个可用在前后端代码同构时,做babel的commonJs转化时。忽略掉css、html的import,在服务器端就可以不用加载这些代码

import html from './example.html';

输出

\\空的

babel-plugin-syntax-dynamic-import

用于支持import语法

import('./Page3Comp');

转换为

Promise.resolve().then(function () {
            return require('./Page3Comp');
        })

results matching ""

    No results matching ""