Skip to content

Commit

Permalink
fix: hashed url handling
Browse files Browse the repository at this point in the history
Had to return `hash` option due to the fact that names generated by `output.assetFileNames` are not awailable in `transform` hook.
Although made it compatible with `assetFileName` placeholder, and assigned Rollup-based default value
  • Loading branch information
Anidetrix committed May 5, 2020
1 parent 816c385 commit 5735a01
Show file tree
Hide file tree
Showing 9 changed files with 288 additions and 248 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import styles from "rollup-plugin-styles";

export default {
output: {
// Governs names of CSS files and assets from CSS URLs
// Governs names of CSS files (for assets from CSS use `hash` option for url handler)
// Recommended value shown below
assetFileNames: "[name]-[hash][extname]",
},
Expand Down
2 changes: 1 addition & 1 deletion __tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ validateMany("basic", [
options: {
mode: "extract",
alias: { "@": fixture("resolvers/features2") },
url: { publicPath: "/pubpath" },
url: { publicPath: "/pubpath", hash: "[name][extname]" },
},
outputOpts: {
assetFileNames: "[name][extname]",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"@typescript-eslint/eslint-plugin": "^2.31.0",
"@typescript-eslint/parser": "^2.31.0",
"autoprefixer": "^9.7.6",
"babel-jest": "^26.0.0",
"babel-jest": "^26.0.1",
"babel-plugin-transform-node-env-inline": "^0.4.3",
"builtin-modules": "^3.1.0",
"eslint": "^6.8.0",
Expand All @@ -100,7 +100,7 @@
"fibers": "^5.0.0",
"gh-pages": "^2.2.0",
"husky": "^4.2.5",
"jest": "^26.0.0",
"jest": "^26.0.1",
"less": "^3.11.1",
"lint-staged": "^10.2.2",
"node-sass": "^4.14.1",
Expand Down

0 comments on commit 5735a01

Please sign in to comment.