mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-27 21:29:55 +03:00
Move Page Modules and special elm-pages modules into app folder.
This commit is contained in:
parent
ce8a3c9e5c
commit
b91f978d24
@ -4,7 +4,8 @@
|
||||
"src",
|
||||
"../../src",
|
||||
".elm-pages",
|
||||
"../../plugins"
|
||||
"../../plugins",
|
||||
"app"
|
||||
],
|
||||
"elm-version": "0.19.1",
|
||||
"dependencies": {
|
||||
|
@ -14,7 +14,7 @@ async function run({ moduleName, withState, serverRender, withFallback }) {
|
||||
withFallback
|
||||
);
|
||||
const fullFilePath = path.join(
|
||||
`src/Page/`,
|
||||
`app/Page/`,
|
||||
moduleName.replace(/\./g, "/") + ".elm"
|
||||
);
|
||||
await fs.tryMkdir(path.dirname(fullFilePath));
|
||||
|
@ -246,7 +246,7 @@ async function start(options) {
|
||||
function needToRerunCodegen(eventName, pathThatChanged) {
|
||||
return (
|
||||
(eventName === "add" || eventName === "unlink") &&
|
||||
pathThatChanged.match(/src\/Page\/.*\.elm/)
|
||||
pathThatChanged.match(/app\/Page\/.*\.elm/)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -8,8 +8,8 @@ const routeHelpers = require("./route-codegen-helpers");
|
||||
* @param {'browser' | 'cli'} phase
|
||||
*/
|
||||
function generateTemplateModuleConnector(basePath, phase) {
|
||||
const templates = globby.sync(["src/Page/**/*.elm"], {}).map((file) => {
|
||||
const captures = mm.capture("src/Page/**/*.elm", file);
|
||||
const templates = globby.sync(["app/Page/**/*.elm"], {}).map((file) => {
|
||||
const captures = mm.capture("app/Page/**/*.elm", file);
|
||||
if (captures) {
|
||||
return path.join(captures[0], captures[1]).split(path.sep);
|
||||
} else {
|
||||
|
@ -20,7 +20,7 @@ function rewriteElmJson(elmJson) {
|
||||
// 1. remove existing path that looks at `Pages.elm`
|
||||
elmJson["source-directories"] = elmJson["source-directories"].filter(
|
||||
(item) => {
|
||||
return item != ".elm-pages";
|
||||
return item != ".elm-pages" && item != "app";
|
||||
}
|
||||
);
|
||||
// 2. prepend ../../../ to remaining
|
||||
|
Loading…
Reference in New Issue
Block a user