mrsum / webpack-svgstore-plugin

Simple svg-sprite creating with webpack
https://www.npmjs.com/package/webpack-svgstore-plugin
200 stars 90 forks source link

Chunkhash remains unchanged with svgXHR #93

Closed dmitrif closed 8 years ago

dmitrif commented 8 years ago

Since SVGXHR code is added during the emit compiler phase, the resulting chunkhash stays the same.

Given dummy.js that is blank, and the following setup:

entry: {
    'common': ['babel-core/external-helpers', 'babel/polyfill', 'react', 'lodash'],
    'svg': ['./app/helpers/dummy.js'],
    'app': ['./app/Boot.jsx']
  },
...
output: {
    publicPath: '/',
    path: path.resolve('./dist'),
    filename: '[name].[chunkhash].js',
    sourceMapFilename: '[file].map'
  },
...
new SvgStore(path.join('app/assets', 'svg', '**/*.svg'), '', {
      prefix: '',
      name: 'sprite.'+ version +'.svg',
      chunk: 'svg',
      svgoOptions: { plugins: require('./svgo.js').constants.plugins() }
    }),

The resulting filename is always identical.

mrsum commented 8 years ago

@dmitrif try 3.0.0-alpha.2 version documentation here https://github.com/mrsum/webpack-svgstore-plugin/blob/feature/refactor/README.md

mrsum commented 8 years ago

fixed. all sprites will has [hash] as timestamp.