Skip to content

Commit

Permalink
Fix fixture test
Browse files Browse the repository at this point in the history
  • Loading branch information
nowycondro committed Sep 14, 2018
1 parent 0104ab5 commit b2a98bb
Show file tree
Hide file tree
Showing 34 changed files with 6,095 additions and 928 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
/example/dist/
npm-debug.log
yarn.lock

.DS_Store
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.11.5
8.7.0
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
language: node_js
node_js:
- "4"
- "5"
- "6"
- "8"
install:
- npm install --ignore-scripts
script:
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 0.0.1

+ Forked favicons-webpack-plugin
+ Updates version favoicons, loader-utils, lodash
+ Updates favoicons, loader-utils, lodash, ava
+ Rename to refavicons-webpack-plugin
+ Throws error if the file path doesn't exist

Expand Down
17 changes: 15 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,21 @@ function ReFaviconsWebpackPlugin (options) {
emitStats: false,
statsFilename: 'iconstats-[hash].json',
persistentCache: true,
inject: true,
inject: true
}, options);

this.options.icons = _.extend({
android: true,
appleIcon: true,
appleStartup: true,
coast: false,
favicons: true,
firefox: true,
opengraph: false,
twitter: false,
yandex: false,
windows: false
}, this.options.icons);
}

ReFaviconsWebpackPlugin.prototype.apply = function (compiler) {
Expand Down Expand Up @@ -56,7 +69,7 @@ ReFaviconsWebpackPlugin.prototype.apply = function (compiler) {
// webpack 4
if (compiler.hooks) {
compiler.hooks.compilation.tap('ReFaviconsWebpackPlugin', function (cmpp) {
cmpp.hooks.htmlWebpackPluginBeforeHtmlProcessing.tapAsync('favicons-webpack-plugin', addFaviconsToHtml);
cmpp.hooks.htmlWebpackPluginBeforeHtmlProcessing.tapAsync('refavicons-webpack-plugin', addFaviconsToHtml);
});
} else {
compiler.plugin('compilation', function (compilation) {
Expand Down
7 changes: 4 additions & 3 deletions lib/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ module.exports.compileTemplate = function compileTemplate (options, context, com
childCompiler.context = context;

var reFaviconsWebpackPluginConfigKeys = ['prefix', 'emitStats', 'statsFilename', 'inject'];
var faviconsConfig = _.omitBy(options, function(value, key) {
var faviconsConfig = _.omitBy(options, function (value, key) {
return reFaviconsWebpackPluginConfigKeys.indexOf(key) >= 0;
})
});
faviconsConfig.outputFilePrefix = options.prefix;

var singleEntryPlugin = new SingleEntryPlugin(context, '!!' + require.resolve('./favicons.js') + '?' +
JSON.stringify(faviconsConfig) + '!' + options.logo);
Expand Down Expand Up @@ -114,5 +115,5 @@ module.exports.compileTemplate = function compileTemplate (options, context, com
function getCompilerName (context, filename) {
var absolutePath = path.resolve(context, filename);
var relativePath = path.relative(context, absolutePath);
return 'favicons-webpack-plugin for "' + (absolutePath.length < relativePath.length ? absolutePath : relativePath) + '"';
return 'refavicons-webpack-plugin for "' + (absolutePath.length < relativePath.length ? absolutePath : relativePath) + '"';
}
Loading

0 comments on commit b2a98bb

Please sign in to comment.