S
S
sinout2016-03-10 02:02:41
JavaScript
sinout, 2016-03-10 02:02:41

Do I need webpack?

I am developing isomorphic js applications, that is, the initial html arrives from the server in which various vendor styles and vendor js files are connected. I set myself the task of bundling vendor styles into one file and custom styles into another, and breaking js into modules and using require. I immediately decided to use the sensational webpack. Everything is fine with js, babel works, everything is bundled. Custom css also works with the extract-text-webpack-plugin.
I don’t understand one thing, how can I include bootstrap and other vendor css files and collect them into one file? Or should I set up gulp+browserify for this kind of task? What do you advise ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
_
_ _, 2016-03-10
@sinout

One of the options

entry: {
    app: ['./src'],
    style: [
      './src/style/app'
    ],
    vendor: [
      'bootstrap/css/bootstrap.min.css',
      'other-lib/other.css'
    ]
  },

This assumes that bootstrap and other-lib are installed via npm.
If you like, you can import the styles you want directly into your stylesheet, like
@import url('~bootstrap/css/bootstrap.min.css');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question