survivejs / webpack-book

From apprentice to master (CC BY-NC-ND)
https://survivejs.com/webpack/
2.42k stars 319 forks source link

webpack: how to ordering dependencies between entries #85

Closed Trispa closed 8 years ago

Trispa commented 8 years ago

in my webpack config file I have two multy entries:

module.exports = {
      entry:{
             lib:["./scripts/file1.js","./scripts/fil2.ts"],
             app:["./scripts/login.js","./public/HSplitLayout.js"]
      },
      output: {
        path: 'builds',
        filename: '[name].js',
        publicPath: 'builds/',
        libraryTarget: "var"
    }
}

I want to ensure that the lib.js file is completely loaded before app.js is loaded.

Thank you for your help

bebraw commented 8 years ago

Are you using html-webpack-plugin? I think it should pick up the script tag order from the definition.

Trispa commented 8 years ago

thansk @bebraw i't work well now. thanks a lot