assets-webpack-plugin
Advanced tools
Comparing version 3.2.0 to 3.3.0
@@ -74,2 +74,6 @@ var merge = require('lodash.merge'); | ||
if (self.options.metadata) { | ||
output.metadata = self.options.metadata; | ||
} | ||
self.writer(output, function (err) { | ||
@@ -76,0 +80,0 @@ if (err) { |
{ | ||
"name": "assets-webpack-plugin", | ||
"version": "3.2.0", | ||
"version": "3.3.0", | ||
"description": "Emits a json file with assets paths", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -135,2 +135,14 @@ assets-webpack-plugin | ||
__metadata__: Inject metadata into the into the output file. All values will be injected into the key "metadata". | ||
```js | ||
new AssetsPlugin({metadata: {version: 123}}) | ||
// Manifest will now contain: | ||
// { | ||
// metadata: {version: 123} | ||
// } | ||
``` | ||
### Using in multi-compiler mode | ||
@@ -137,0 +149,0 @@ |
@@ -303,2 +303,37 @@ /*jshint expr: true*/ | ||
it('allows injection of metadata', function (done) { | ||
var webpackConfig = { | ||
entry: path.join(__dirname, 'fixtures/one.js'), | ||
output: { | ||
path: OUTPUT_DIR, | ||
filename: 'index-bundle.js' | ||
}, | ||
plugins: [new Plugin({ | ||
path: 'tmp', | ||
metadata: { | ||
foo: 'bar', | ||
baz: 'buz' | ||
} | ||
})] | ||
}; | ||
var expected = { | ||
main: { | ||
js: 'index-bundle.js' | ||
}, | ||
metadata: { | ||
foo: 'bar', | ||
baz: 'buz' | ||
} | ||
}; | ||
expected = JSON.stringify(expected); | ||
var args = { | ||
config: webpackConfig, | ||
expected: expected | ||
}; | ||
expectOutput(args, done); | ||
}); | ||
}); |
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
35382
950
215