Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kelyvin committed Apr 30, 2019
1 parent 27285bd commit fede4b7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const defaultJsonOptions = {
space: 2
}

function GenerateJsonFromJsPlugin(config = {}) {
function GenerateJsonFromJsPlugin (config = {}) {
Object.assign(this, {
...config,
filePath: config.path,
Expand All @@ -21,7 +21,7 @@ function GenerateJsonFromJsPlugin(config = {}) {
this.plugin = 'GenerateJsonFromJsPlugin'
}

GenerateJsonFromJsPlugin.prototype.apply = function apply(compiler) {
GenerateJsonFromJsPlugin.prototype.apply = function apply (compiler) {
const emit = (compilation, callback) => {
const fullFilePath = path.resolve(compiler.context, this.filePath)

Expand All @@ -39,15 +39,14 @@ GenerateJsonFromJsPlugin.prototype.apply = function apply(compiler) {
...jsModule,
...this.data
}

}

if (jsonValue) {
const json = JSON.stringify(jsonValue, this.options.replacer, this.options.space)

compilation.assets[this.filename] = {
source: () => json,
size: () => json.length,
size: () => json.length
}
}

Expand Down

0 comments on commit fede4b7

Please sign in to comment.