Comments (1)
There's a major problem with doing this that we need to tackle.
An app(or page)-template.js could(probably will) include additional components, such as a header, footer, sidebar, who knows. When they import those components, lets say we force them to use a standard folder, for example src/components
okay all the components go in there. Fine.
But... when we build, it needs to copy those files over to the scratchDirectory. This is where the problem begins.
so my user example project could be
├── src
│ ├── components
│ │ └── index.js
│ ├── pages
│ │ └── hello.md
│ └── templates
│ ├── app-template.js
│ └── page-template.js
so the app-template.js if it wants to include the components, it needs to:
import '../component/index.js`
No problem right?
Well, the problem is when this app-template turns into a app.js file within the .greenwood
scratch directory, no components folder exists and if we create it, it still won't be the correct path for the relative import above.
import './components/index.js`
works, but that's so anti-practise.
edit: actually came up with a small solution. the app.js file must be placed in any directory so that the relative import paths (whatever they are) at least are correct. So I'm putting the app.js into a .greenwood/app/app.js
directory and modifying webpack entry point. I'll also put the list.js (which is also broken by this path change) in that app directory as well by default.
from greenwood.
Related Issues (20)
- custom response and constructor props for SSR pages
- support all CSS function pseudo classes / elements for CSS optimizing
- `static` property initializations break during bundling HOT 1
- "no custom element class found for this file" warning when prerendering with WCC HOT 1
- `develop` command fails on creating import map with `Failed to parse URL` error (Node >= 18.19.0)
- Lit v3 upgrade and SSR Pages support and compatibility for renderer plugin
- support bundling of `url` properties (like for `@font-face` + `src`) during CSS file optimization
- Upgrade to Node `20.x` (latest LTS)
- Resumability HOT 1
- Import Attributes support in Acorn
- align assets and build output directory naming conventions
- migrate to register function for NodeJS custom imports (no more flag!)
- HTML Modules plugin (experimental)
- leverage `Sec-Fetch-Dest` header for better filtering within Greenwood resource plugins
- nested SSR pages throwing a module not found error (needs additional patch for adapters) HOT 1
- improve naming for (nested) bundled SSR page and API route entry points to better reflect original file based routing name
- apply CSS optimizations and bundling to CSS (in) modules
- `<script>` tags of type `application/json` are breaking production builds
- Sitemap Generation HOT 5
- CSS Modules ™️ plugin
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from greenwood.