Webpack 2 with gazebo

I am currently working on a project that partially depends on dependencies only on "bower only", and I need to somehow add the bower_components module to Webpack 2. How can I do this? The documentation from the previous version does not work, and the bower-webpack-plugin is out of date. I am using Webpack@2.2.1. I added this code to webpack.config.js:

resolve: {
    extensions: ['.js', '.jsx'],
    modules: ['bower_components', 'node_modules']
}

But, unfortunately, this does not work.

+4
source share
2 answers

Use current version of documentation

The correct solution to the path to bower_componentsusing the module pathhelped me. Perhaps this will help you.

0
source

Webpack2 , : https://gist.github.com/sokra/27b24881210b56bbaff7#resolving-options

webpack.config.js bower.json:

module.exports = {
    entry: './file.js',
    output: {
        filename: 'my-first-webpack.bundle.js'
    },
    resolve: {
        modules: [ "bower_components"],
        descriptionFiles: ["bower.json"]
    }
};
0

Source: https://habr.com/ru/post/1668884/


All Articles