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

CSS file linked from HTML entry is not copied to workspaceDir and ignored in the output #152

Open
MurakamiShinyu opened this issue Mar 6, 2021 · 1 comment
Assignees

Comments

@MurakamiShinyu
Copy link
Member

When the config file has entry setting with an HTML file, that has a link to a CSS file, and has workspaceDir setting, the CSS is not copied to the workspaceDir and the style is ignored in the output. e.g.:

vivliostyle.config.js:

module.exports = {
  entry: [ 
    "test.html",
  ],
  workspaceDir: "workspace",
};

test.html:

<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <h1>Hello, world!</h1>
</body>
</html>

style.css:

h1 {
  color: green;
}

In this example, the style in the style.css is ignored.

Why DEFAULT_ASSETS not including '**/*.css'?

const DEFAULT_ASSETS = [
'**/*.png',
'**/*.jpg',
'**/*.jpeg',
'**/*.svg',
'**/*.gif',
'**/*.webp',
'**/*.apng',
'**/*.ttf',
'**/*.otf',
'**/*.woff',
'**/*.woff2',
];

@MurakamiShinyu
Copy link
Member Author

MurakamiShinyu commented Mar 26, 2021

DEFAULT_ASSETS'**/*.css' を加えるだけの修正では、vivliostyle.config.js 内に theme の css と entryContextDir の指定があるとき theme の css が2つコピーされてしまう問題があることに気がつきました。
そこで theme と entryContextDir について見直しを行い、次の提案を書きました:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants