Created
August 19, 2015 20:56
-
-
Save joakin/884cf3a1b013944f8dd1 to your computer and use it in GitHub Desktop.
Track i18n keys
This file contains hidden or 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
var ConstDependency = require("webpack/lib/dependencies/ConstDependency"); | |
var NullFactory = require("webpack/lib/NullFactory"); | |
module.exports = ResourceLoaderGenerator; | |
function ResourceLoaderGenerator (opts) { | |
opts = opts || {}; | |
this.functionName = opts.functionName || 'msg'; | |
} | |
ResourceLoaderGenerator.prototype.apply = function(compiler) { | |
compiler.plugin("compilation", function(compilation, params) { | |
// compilation.dependencyFactories.set(ConstDependency, new NullFactory()); | |
// compilation.dependencyTemplates.set(ConstDependency, new ConstDependency.Template()); | |
}); | |
compiler.parser.plugin("call " + this.functionName, function (expr) { | |
console.dir(expr); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@joakin, you can use https://github.com/oliviertassinari/i18n-extract if you just when to extract a list of key