avet-assets
Advanced tools
Comparing version 1.0.0 to 1.1.0
exports.assets = { | ||
extensions: ['txt', 'svg', 'png', 'jpg', 'jpeg', 'webp', 'gif'], | ||
extensions: [ 'txt', 'svg', 'png', 'jpg', 'jpeg', 'webp', 'gif' ], | ||
regExp: '.*/static/(.+)', | ||
@@ -9,2 +9,14 @@ name: '/static/[1]?[sha512:hash:base64:7]', | ||
babel: (babelConfig, config) => { | ||
let { name } = config.assets; | ||
if (config.build.assetPrefix) { | ||
const uuid = require('uuid'); | ||
const buildId = uuid.v4(); | ||
config.build.buildId = buildId; | ||
name = | ||
config.build.assetPrefix.replace(/\/$/, '') + | ||
name.replace('static', `static/${buildId}`); | ||
} | ||
babelConfig.plugins.push([ | ||
@@ -15,3 +27,3 @@ require.resolve('babel-plugin-transform-assets'), | ||
regExp: config.assets.regExp, | ||
name: config.assets.name, | ||
name, | ||
}, | ||
@@ -18,0 +30,0 @@ ]); |
{ | ||
"name": "avet-assets", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "avet assets", | ||
@@ -8,10 +8,6 @@ "avetPlugin": { | ||
}, | ||
"keywords": [ | ||
"avet", | ||
"avetPlugin", | ||
"avet-plugin", | ||
"assets" | ||
], | ||
"keywords": ["avet", "avetPlugin", "avet-plugin", "assets"], | ||
"dependencies": { | ||
"babel-plugin-transform-assets": "0.2.0" | ||
"babel-plugin-transform-assets": "0.2.0", | ||
"uuid": "^3.1.0" | ||
}, | ||
@@ -30,7 +26,4 @@ "devDependencies": { | ||
}, | ||
"files": [ | ||
"config", | ||
"app.js" | ||
], | ||
"files": ["config", "app.js"], | ||
"license": "MIT" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2440
27
2
+ Addeduuid@^3.1.0
+ Addeduuid@3.4.0(transitive)