-
-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
trying to isolate failing test situation
- Loading branch information
1 parent
712f4d2
commit 94b3587
Showing
2 changed files
with
46 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
const { join } = require('path'); | ||
const fs = require('fs'); | ||
|
||
const webpack = require('webpack'); | ||
|
||
const { WebpackManifestPlugin } = require('../../lib'); | ||
|
||
const outputPath = join(__dirname, '../output/unit', 'auxiliary-assets'); | ||
const config = { | ||
context: __dirname, | ||
entry: '../fixtures/import_image.js', | ||
output: { | ||
path: outputPath, | ||
assetModuleFilename: `images/[name].[hash:4][ext]`, | ||
filename: '[name].js', | ||
publicPath: '' | ||
}, | ||
optimization: { chunkIds: 'named' }, | ||
plugins: [new WebpackManifestPlugin({})], | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.(png)/, | ||
type: 'asset/resource' | ||
} | ||
] | ||
} | ||
}; | ||
|
||
const compiler = webpack(config); | ||
|
||
compiler.run((error, stats) => { | ||
if (error) { | ||
throw error; | ||
} | ||
|
||
if (stats.hasErrors()) { | ||
console.log('Stat Errors', stats.toJson()); | ||
} | ||
|
||
const manifest = fs.readFileSync(join(outputPath, 'manifest.json')).toString(); | ||
|
||
console.log(manifest); | ||
}); |