mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-15 06:35:20 -07:00
Use Webpack to copy static folder
This commit is contained in:
parent
db0954f46f
commit
354d1161f3
1 changed files with 28 additions and 0 deletions
28
next.config.js
Normal file
28
next.config.js
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
const path = require("path")
|
||||
const CopyPlugin = require("copy-webpack-plugin")
|
||||
|
||||
module.exports = {
|
||||
// target: "serverless",
|
||||
// future: {
|
||||
// webpack5: true,
|
||||
// },
|
||||
webpack: function (config, { dev, isServer }) {
|
||||
// Fixes npm packages that depend on `fs` module
|
||||
if (!isServer) {
|
||||
config.resolve.fallback.fs = false
|
||||
}
|
||||
// Copy files to serverless functions
|
||||
if (!dev) {
|
||||
config.plugins.push(
|
||||
new CopyPlugin({
|
||||
patterns: [{
|
||||
from: 'static',
|
||||
to: 'static'
|
||||
}],
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
return config
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue