|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
867 bytes
|
| Rev | Line | |
|---|
| [9af201e] | 1 | // @ts-check
|
|---|
| 2 |
|
|---|
| 3 | /**
|
|---|
| 4 | * @typedef {{type: 'dependency', file: string} | {type: 'dir-dependency', dir: string, glob: string}} Dependency
|
|---|
| 5 | */
|
|---|
| 6 |
|
|---|
| 7 | /**
|
|---|
| 8 | *
|
|---|
| 9 | * @param {import('../lib/content.js').ContentPath} contentPath
|
|---|
| 10 | * @returns {Dependency[]}
|
|---|
| 11 | */
|
|---|
| 12 | export default function parseDependency(contentPath) {
|
|---|
| 13 | if (contentPath.ignore) {
|
|---|
| 14 | return []
|
|---|
| 15 | }
|
|---|
| 16 |
|
|---|
| 17 | if (!contentPath.glob) {
|
|---|
| 18 | return [
|
|---|
| 19 | {
|
|---|
| 20 | type: 'dependency',
|
|---|
| 21 | file: contentPath.base,
|
|---|
| 22 | },
|
|---|
| 23 | ]
|
|---|
| 24 | }
|
|---|
| 25 |
|
|---|
| 26 | if (process.env.ROLLUP_WATCH === 'true') {
|
|---|
| 27 | // rollup-plugin-postcss does not support dir-dependency messages
|
|---|
| 28 | // but directories can be watched in the same way as files
|
|---|
| 29 | return [
|
|---|
| 30 | {
|
|---|
| 31 | type: 'dependency',
|
|---|
| 32 | file: contentPath.base,
|
|---|
| 33 | },
|
|---|
| 34 | ]
|
|---|
| 35 | }
|
|---|
| 36 |
|
|---|
| 37 | return [
|
|---|
| 38 | {
|
|---|
| 39 | type: 'dir-dependency',
|
|---|
| 40 | dir: contentPath.base,
|
|---|
| 41 | glob: contentPath.glob,
|
|---|
| 42 | },
|
|---|
| 43 | ]
|
|---|
| 44 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.