Unify webpack configuration with webpack-config-template#204
Unify webpack configuration with webpack-config-template#204theimowski merged 10 commits intoSAFE-Stack:masterfrom
Conversation
5a80a24 to
895b9f6
Compare
|
/cc @alfonsogarciacaro @isaacabraham @MangelMaxime want to review? |
| // In development, bundle styles together with the code so they can also | ||
| // trigger hot reloads. In production, put them in a separate CSS file. | ||
| entry: isProduction ? { | ||
| app: [resolve(CONFIG.fsharpEntry), resolve(CONFIG.cssEntry)] |
There was a problem hiding this comment.
You can simplify the entries by removing resolve.
Webpack expect an absolute path only for the output.path node.
There was a problem hiding this comment.
The webpack.config.js is now downloaded from webpack-config-template repository. Actually I might consider gitignoring this file to prevent confusion
There was a problem hiding this comment.
Ah ok, so this why the build.fsx is modifying it to add api things.
There was a problem hiding this comment.
Exactly, as @alfonsogarciacaro suggested, we should stick to single source of truth, which I'm happy to do
There was a problem hiding this comment.
Yes i have no problem with that :)
I just review this PR as asked. We can wait to see if Alfonso wants to modify the original file with my comments or no I guess.
| }; | ||
|
|
||
| function resolve(filePath) { | ||
| return path.isAbsolute(filePath) ? filePath : path.join(__dirname, filePath); |
There was a problem hiding this comment.
You can simplify by using:
function resolve(filePath) {
return path.join(__dirname, filePath)
}There was a problem hiding this comment.
Same as above - the file comes from webpack-config-template
d770edf to
f4d2750
Compare
Idea is to take webpack configuration from https://github.com/fable-compiler/webpack-config-template , adjust a couple of configuration values and include in the template, instead of maintaining a separate different webpack conf