Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't resolve CSS file with custom workspace #85

Closed
1 of 5 tasks
thescientist13 opened this issue May 17, 2019 · 6 comments
Closed
1 of 5 tasks

can't resolve CSS file with custom workspace #85

thescientist13 opened this issue May 17, 2019 · 6 comments
Assignees
Labels
bug Something isn't working question Further information is requested v0.10.0

Comments

@thescientist13
Copy link
Member

Type of Change

  • New Feature Request
  • Documentation / Website
  • Improvement / Suggestion
  • Bug
  • Other (please clarify below)

Summary

Trying to create a project with a custom page template and shared CSS file and getting a build error. (related to #80 )

$ yarn build
yarn run v1.12.3
$ yarn clean && node ./packages/cli/index.js build
$ rimraf ./**/.greenwood/** && rimraf ./**/public/** && rimraf ./coverage
-------------------------------------------------------
Welcome to Greenwood ♻️
-------------------------------------------------------
Reading project config
Initializing project workspace contexts
Generating graph of workspace files...
Scaffolding out project files...
Generate pages from templates...
Writing imports for md...
Writing Lit routes...
setup index page and html
Scaffolding complete.
Building project for production.
Building SPA from compilation...
./.greenwood/about/about.js
Module not found: Error: Can't resolve '../theme.css' in '/Users/owenbuckley/Workspace/project-evergreen/repos/greenwood/.greenwood/about'

Details

Workspace

www/
   pages/
     index.md
     about.md
    templates/ 
      page-template.js
    theme.css

Config

const path = require('path');

module.exports = {
  workspace: path.join(__dirname, 'www'),
  title: 'Greenwood',
  meta: [
    { property: 'og:site', content: 'greenwood' },
    { name: 'twitter:site', content: '@PrjEvergreen' }
  ]
};

Note: I wasn't able to reproduce in the build.default.workspace-template-page-style even after adding a pages/ directory with an index.md and about.md so I think it could be related to using a custom workspace?

@thescientist13 thescientist13 added bug Something isn't working P0 Critical issue that should get addressed ASAP labels May 17, 2019
@thescientist13 thescientist13 self-assigned this May 17, 2019
@thescientist13 thescientist13 changed the title can't resolve CSS file with custom workspace (?) can't resolve CSS file with custom workspace May 17, 2019
@thescientist13
Copy link
Member Author

Confirmed it via spec using just an index.md. So it's definitely related to custom workspace

@thescientist13 thescientist13 mentioned this issue May 17, 2019
8 tasks
@thescientist13
Copy link
Member Author

thescientist13 commented May 17, 2019

Oh, I think I see the issue.. it's because if it isn't in a directory, the import won't get mapped by webpack.

So instead of

www/
  theme.css

it will work as this though

www/
  styles/
    theme.css

@thescientist13 thescientist13 removed the P0 Critical issue that should get addressed ASAP label May 17, 2019
@hutchgrant
Copy link
Member

yes it needs to be in a folder to get imported correctly by nodemodulereplacement

@thescientist13
Copy link
Member Author

I think we've covered this through the docs that everything needs to be in a directory. Not sure what the effort is to support this or if it's worth it?

@thescientist13 thescientist13 added the question Further information is requested label Aug 15, 2019
@thescientist13
Copy link
Member Author

I think this is resolved now with #355 , maybe just need to make sure there is a test for this

@thescientist13 thescientist13 mentioned this issue Nov 12, 2020
12 tasks
@thescientist13
Copy link
Member Author

not sure this is an issue anymore in v0.10.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested v0.10.0
Projects
None yet
Development

No branches or pull requests

2 participants