Skip to content

Commit

Permalink
fix(config): prevent invalid css filenames in webpack output (#8778)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Feb 8, 2021
1 parent d343d85 commit 073157f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/config/src/config/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default () => ({
// { isDev, isClient, isServer }
app: ({ isDev, isModern }) => isDev ? `[name]${isModern ? '.modern' : ''}.js` : `[contenthash:7]${isModern ? '.modern' : ''}.js`,
chunk: ({ isDev, isModern }) => isDev ? `[name]${isModern ? '.modern' : ''}.js` : `[contenthash:7]${isModern ? '.modern' : ''}.js`,
css: ({ isDev }) => isDev ? '[name].css' : '[name].[contenthash:7].css',
css: ({ isDev }) => isDev ? '[name].css' : 'css/[contenthash:7].css',
img: ({ isDev }) => isDev ? '[path][name].[ext]' : 'img/[name].[contenthash:7].[ext]',
font: ({ isDev }) => isDev ? '[path][name].[ext]' : 'fonts/[name].[contenthash:7].[ext]',
video: ({ isDev }) => isDev ? '[path][name].[ext]' : 'videos/[name].[contenthash:7].[ext]'
Expand Down
2 changes: 1 addition & 1 deletion packages/config/test/config/build.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('config: build', () => {
const env = { isDev: false }
expect(filenames.app(env)).toEqual('[contenthash:7].js')
expect(filenames.chunk(env)).toEqual('[contenthash:7].js')
expect(filenames.css(env)).toEqual('[name].[contenthash:7].css')
expect(filenames.css(env)).toEqual('css/[contenthash:7].css')
expect(filenames.img(env)).toEqual('img/[name].[contenthash:7].[ext]')
expect(filenames.font(env)).toEqual('fonts/[name].[contenthash:7].[ext]')
expect(filenames.video(env)).toEqual('videos/[name].[contenthash:7].[ext]')
Expand Down

0 comments on commit 073157f

Please sign in to comment.