0

I have a Multi Page Application,

entry: {
        vendor: ['vue', 'vue-router'],
        index: path.join(__dirname,'../src/pages/index' ,'main.js'),
        page2: path.join(__dirname,'../src/pages/page2' ,'main.js'),
    },

add the url-loader like this:

rules: [
            {
                test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
                loader: 'url-loader',
                options: {
                  limit: 10000,
                  name: '/img/[name].[hash:7].[ext]'
                }
            }
        ]

after npm run build i get a dist fold like this : dist file

but I want bundle the img fold into the different fold like this:

        ├─index
        |   ├─img   //bundle img fold here
        |   ├─css
        |   └─js 
        |
        ├─page1
        |   ├─img      //bundle img fold here
        |   ├─css
        |   ├─js
        |   └─index.html
        |
        ├─page2
        |   ├─img    //bundle img fold here
        |   ├─css
        |   ├─js
        |   └─index.html
        |

is it possible do like this?

Leon
  • 11
  • 5
  • Multiple configuration can be a solution https://webpack.js.org/configuration/configuration-types/#exporting-multiple-configurations – M Ashraful A Apr 18 '18 at 07:35
  • @MAshrafulA thanks for the reply! That's basically exactly what I wanted. – Leon Apr 19 '18 at 05:53

0 Answers0