diff --git a/examples/with-hashed-statics/.babelrc b/examples/with-hashed-statics/.babelrc deleted file mode 100644 index 6df96763..00000000 --- a/examples/with-hashed-statics/.babelrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "presets": ["next/babel"], - "plugins": [ - [ - "transform-assets", - { - "extensions": ["txt", "svg", "png"], - "regExp": ".*/static/(.+)", - "name": "/static/[1]?[sha512:hash:base64:7]" - } - ] - ] -} diff --git a/examples/with-hashed-statics/next.config.js b/examples/with-hashed-statics/next.config.js new file mode 100644 index 00000000..727dd120 --- /dev/null +++ b/examples/with-hashed-statics/next.config.js @@ -0,0 +1,19 @@ +module.exports = { + webpack: config => { + config.module.rules.push({ + test: /\.(txt|jpg|png|svg)$/, + use: [ + { + loader: 'file-loader', + options: { + context: '', + emitFile: true, + name: '[path][name].[hash].[ext]' + } + } + ] + }) + + return config + } +} diff --git a/examples/with-hashed-statics/package.json b/examples/with-hashed-statics/package.json index a40f818b..76c1a497 100644 --- a/examples/with-hashed-statics/package.json +++ b/examples/with-hashed-statics/package.json @@ -9,5 +9,8 @@ "next": "latest", "react": "16.2.0", "react-dom": "16.2.0" + }, + "devDependencies": { + "file-loader": "2.0.0" } }