-
-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- fix wrong path import (was importing path/posix instead of path - add vinyl-sourcempas-apply to external (rollup config) - run prettier
- Loading branch information
Showing
14 changed files
with
63 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import { | ||
UserDefinedOptions as PurgeCSSUserDefinedOptions, | ||
RawContent | ||
RawContent, | ||
} from "purgecss"; | ||
|
||
|
||
/** | ||
* {@inheritDoc purgecss#UserDefinedOptions} | ||
* | ||
* | ||
* @public | ||
*/ | ||
export interface UserDefinedOptions extends Omit<PurgeCSSUserDefinedOptions,"content" | "css"> { | ||
content?: PurgeCSSUserDefinedOptions['content']; | ||
export interface UserDefinedOptions | ||
extends Omit<PurgeCSSUserDefinedOptions, "content" | "css"> { | ||
content?: PurgeCSSUserDefinedOptions["content"]; | ||
contentFunction?: (sourceFile: string) => Array<string | RawContent>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,30 @@ | ||
import { PurgeCSS } from '../src/' | ||
import { ROOT_TEST_EXAMPLES } from './utils'; | ||
import { PurgeCSS } from "../src/"; | ||
import { ROOT_TEST_EXAMPLES } from "./utils"; | ||
|
||
describe("source map option", () => { | ||
it('contains the source map inlined in the CSS file', async () => { | ||
it("contains the source map inlined in the CSS file", async () => { | ||
const resultsPurge = await new PurgeCSS().purge({ | ||
content: [`${ROOT_TEST_EXAMPLES}others/remove_unused.js`], | ||
css: [`${ROOT_TEST_EXAMPLES}others/remove_unused.css`], | ||
sourceMap: true | ||
sourceMap: true, | ||
}); | ||
|
||
expect(resultsPurge[0].css).toContain('sourceMappingURL=data:application/json;base64'); | ||
expect(resultsPurge[0].css).toContain( | ||
"sourceMappingURL=data:application/json;base64" | ||
); | ||
}); | ||
|
||
it('contains the source map separately when setting inline to false', async () => { | ||
it("contains the source map separately when setting inline to false", async () => { | ||
const resultsPurge = await new PurgeCSS().purge({ | ||
content: [`${ROOT_TEST_EXAMPLES}others/remove_unused.js`], | ||
css: [`${ROOT_TEST_EXAMPLES}others/remove_unused.css`], | ||
sourceMap: { | ||
inline: false | ||
} | ||
inline: false, | ||
}, | ||
}); | ||
|
||
expect(resultsPurge[0].sourceMap).toContain('sources":["__tests__/test_examples/others/remove_unused.css"]'); | ||
}) | ||
expect(resultsPurge[0].sourceMap).toContain( | ||
'sources":["__tests__/test_examples/others/remove_unused.css"]' | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
declare module 'vinyl-sourcemaps-apply'; | ||
declare module "vinyl-sourcemaps-apply"; |