Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

270
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda