How to use the webpack-inject-plugin.ENTRY_ORDER function in webpack-inject-plugin

To help you get started, we’ve selected a few webpack-inject-plugin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github project-yuki / YUKI / .electron-vue / webpack.main.config.js View on Github external
},
  node: {
    __dirname: process.env.NODE_ENV !== "production",
    __filename: process.env.NODE_ENV !== "production"
  },
  output: {
    filename: "[name].js",
    libraryTarget: "commonjs2",
    path: path.join(__dirname, "../dist/electron")
  },
  plugins: [
    new InjectPlugin.default(
      function() {
        return "process.env.DEBUG = 'yuki:*';process.env.DEBUG_COLORS = '1';";
      },
      { entryOrder: InjectPlugin.ENTRY_ORDER.First }
    ),
    new webpack.NoEmitOnErrorsPlugin()
  ],
  resolve: {
    extensions: [".ts", ".js", ".json", ".node"]
  },
  target: "electron-main"
};

/**
 * Adjust mainConfig for development settings
 */
if (process.env.NODE_ENV !== "production") {
  mainConfig.plugins.push(
    new webpack.DefinePlugin({
      __static: `"${path.join(__dirname, "../static").replace(/\\/g, "\\\\")}"`

webpack-inject-plugin

A webpack plugin to dynamically inject code into the bundle.

MIT
Latest version published 4 years ago

Package Health Score

44 / 100
Full package analysis