Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

271
Views
Use script to load js files dynamically. Why is the CSS extracted from the corresponding mini-css-extract-plugin not automatically loaded

I use these:

webpack: 4.41.2;

vue: 2.6.11;

mini-css-extract-plugin: 1.3.5;

I use two.vue files as entry files

{
  entry: {
    view: join(__dirname, '../src/index.vue'),
    edit: join(__dirname, '../editor/index.vue')
  },
  output: {
    path: path.join(__dirname, '../dist'),
    library: `[name]-${uuid}-${version}`,
    libraryTarget: 'umd',
    filename: `${version}-[name].js`,
  },
}

I'm using the mini-CSs-extract-plugin to extract the CSS file

loader

{
        test: /\.less$/,
        use: [
          {
            loader: MiniCssExtractPlugin.loader
          },
          // 'vue-style-loader',
          'css-loader',
          'postcss-loader',
          'less-loader',
        ]
      },
      {
        test: /\.css$/,
        use: [
          {
            loader: MiniCssExtractPlugin.loader
          },
          // 'vue-style-loader',
          'css-loader',
          'postcss-loader'
        ]
      },

plugins:

plugins: [
    // new webpack.NoEmitOnErrorsPlugin(),
    // new webpack.NamedModulesPlugin(),
    new MiniCssExtractPlugin(),
    new VueLoaderPlugin()
  ],

The packaged files are as follows:

enter image description here

When I load 1.9.6-edit.js or 1.9.6-view.js at another site manually by document.createElement('script'), The corresponding edit.css/view.css are not automatically added to the page

What should I do?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!