Compare commits
2 Commits
9e136fa1b3
...
c05fd94028
Author | SHA1 | Date | |
---|---|---|---|
c05fd94028 | |||
9879a03e03 |
@ -48,6 +48,7 @@ let
|
||||
name,
|
||||
src,
|
||||
nodePackages ? null,
|
||||
routes ? [ "/" ],
|
||||
}:
|
||||
let
|
||||
nodeSource = symlinkJoin {
|
||||
@ -56,6 +57,12 @@ let
|
||||
builderPkg.lib
|
||||
] ++ (if nodePackages != null then [ nodePackages ] else [ ]);
|
||||
};
|
||||
|
||||
baseWebpackConfig = builtins.readFile ./webpack.config.js;
|
||||
webpackConfig = ''
|
||||
const ROUTES = ${builtins.toJSON routes}
|
||||
'' + "\n" + baseWebpackConfig;
|
||||
webpackConfigFile = pkgs.writeText "${name}-webpack-config" webpackConfig;
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
inherit name;
|
||||
@ -70,6 +77,7 @@ let
|
||||
|
||||
patchPhase = ''
|
||||
ln -sf ${nodeSource}/node_modules .
|
||||
cp ${webpackConfigFile} webpack.config.js
|
||||
'';
|
||||
|
||||
shellHook = ''
|
||||
|
@ -1,5 +1,3 @@
|
||||
const ROUTES = ['/', '/about', '/404', '/posts', '/posts/viveahk', '/posts/librebasics']
|
||||
|
||||
const path = require('path')
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
const PrerenderSPAPlugin = require('prerender-spa-plugin')
|
||||
|
Loading…
Reference in New Issue
Block a user