How to use the webpack-theme-color-replacer function in webpack-theme-color-replacer

To help you get started, we’ve selected a few webpack-theme-color-replacer 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 choerodon / choerodon-front-boot / src / bin / common / webpackConfig / getWebpackCommonConfig.js View on Github external
} else if (percentage === 1) {
          // eslint-disable-next-line no-console
          console.log(chalk.green('\nwebpack: bundle build is now finished.'));
          if (processTimer) {
            clearInterval(processTimer);
          }
        }
      }
    }),
    new FriendlyErrorsWebpackPlugin(),
    new webpack.ProvidePlugin({
      Choerodon: isDev
        ? join(process.cwd(), `node_modules/@choerodon/${masterName}/lib/containers/common`)
        : join(__dirname, `../../../${masterName}/lib/containers/common`),
    }),
    new ThemeColorReplacer({
      fileName: cssColorFileName,
      matchColors: [
        colorPalette(baseColor, 1),
        colorPalette(baseColor, 2),
        colorPalette(baseColor, 3),
        colorPalette(baseColor, 4),
        colorPalette(baseColor, 5),
        baseColor,
        colorPalette(baseColor, 7),
        colorPalette(baseColor, 8),
        colorPalette(baseColor, 9),
        colorPalette(baseColor, 10),
        '#303f9f', // 左上角颜色
        '140, 158, 255, 0.12', // menu-item背景
        '140, 158, 255, 0.16', // 左侧菜单menu-item背景
      ],

webpack-theme-color-replacer

A webpack plugin designed to dynamicly change the theme colors at runtime. 实现运行时快速动态替换主题色的webpack插件.

MIT
Latest version published 4 months ago

Package Health Score

62 / 100
Full package analysis