This repository has been archived by the owner on Mar 8, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add async hook webappWebpackPluginBeforeEmit (#113)
- Loading branch information
1 parent
efea9ed
commit 3a9d1da
Showing
27 changed files
with
180 additions
and
246 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
File renamed without changes.
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,11 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<title>WebApp</title> | ||
</head> | ||
<body> | ||
</body> | ||
</html> |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,54 @@ | ||
const path = require('path'); | ||
const webpack = require('webpack'); | ||
const HtmlWebpackPlugin = require('html-webpack-plugin'); | ||
const WebappWebpackPlugin = require('../../src/'); | ||
|
||
module.exports = (env, args) => { | ||
return { | ||
context: __dirname, | ||
entry: './src/app.js', | ||
output: { | ||
path: path.resolve(__dirname, 'public'), | ||
publicPath: '/myapp/', | ||
}, | ||
plugins: [ | ||
new HtmlWebpackPlugin({ | ||
template: './src/index.html', | ||
}), | ||
|
||
new WebappWebpackPlugin({ | ||
logo: './src/logo.svg', | ||
prefix: 'path/to/assets/', | ||
|
||
// Favicons configuration | ||
// For the complete list of options, see https://github.com/evilebottnawi/favicons#usage | ||
favicons: { | ||
appName: 'My WebApp', | ||
appShortName: 'WebApp', | ||
appDescription: 'My awesome WebApp', | ||
developerName: 'Me', | ||
developerURL: "https://github.com/me/", | ||
version: "1.0.0", | ||
}, | ||
}), | ||
|
||
new class { | ||
apply(compiler) { | ||
compiler.hooks.make.tapAsync("CustomPlugin", (compilation, callback) => { | ||
compilation.hooks.webappWebpackPluginBeforeEmit.tapAsync("CustomPlugin", (result, callback) => { | ||
console.log(result.assets.map(({name}) => name)); | ||
console.log() | ||
console.log("### Add custom logic to modify assets here ###"); | ||
console.log() | ||
return callback(null, result); | ||
}); | ||
|
||
return callback(); | ||
}) | ||
} | ||
} | ||
], | ||
|
||
stats: "errors-only" | ||
}; | ||
} |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
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,14 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html lang="es-MX"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<title>Home</title> | ||
</head> | ||
|
||
<body> | ||
</body> | ||
|
||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<title>WebApp</title> | ||
</head> | ||
<body> | ||
</body> | ||
</html> |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.