加载中...

ComponentWebpackPlugin


用法

查看一个例子: webpack/webpack/examples/component

var ComponentPlugin = require("component-webpack-plugin");
module.exports = {
    plugins: [
        new ComponentPlugin();
    ]
} 

高级用法

var ComponentPlugin = require("component-webpack-plugin");
module.exports = {
    plugins: [
        new ComponentPlugin({
            // Load xyz field in component.json
            xyz: true,
            // This is equal to: xyz: "[file]"

            // Load xyz field with the xyz-loader
            xyz: "!xyz-loader![file]",

            // This is default:
            // styles: "!style-loader!css-loader![file]"
        }, [
            // Lookup paths
            "component"
        ]);
    ]
} 

License

MIT (http://www.opensource.org/licenses/mit-license.php)

原文:https://webpack.js.org/plugins/component-webpack-plugin/


还没有评论.