Comparing version 1.0.17 to 1.0.18
@@ -14,3 +14,3 @@ var path = require('path'); | ||
function buildWebpackConfiguration(defaultConfig, name, baseURL, sourcePath, destPath, compress = true) { | ||
function buildWebpackConfiguration(defaultConfig, name, baseURL, sourcePath, destPath, compress) { | ||
var examplePlugins = [ | ||
@@ -61,3 +61,3 @@ new HtmlWebpackPlugin({ | ||
module.exports = function(templateData, done) { | ||
module.exports = function(templateData, done, compress) { | ||
const baseExampleDirectory = path.join(templateData.directories.work, 'public/examples'); | ||
@@ -84,3 +84,3 @@ const markdownBaseExample = path.join(templateData.directories.work, 'source/examples'); | ||
shell.rm('-rf', destPath + '/*'); | ||
examplesToBuild.push({ name: className, destPath: destPath, sourcePath: sourcePath }); | ||
examplesToBuild.push({ name: className, destPath: destPath, sourcePath: sourcePath, compress: compress }); | ||
@@ -151,3 +151,3 @@ var fullSplittedPath = getSplitedPath(sourcePath); | ||
var example = list.pop(); | ||
var config = buildWebpackConfiguration(defaultConfig, example.name, baseURL, example.sourcePath, example.destPath); | ||
var config = buildWebpackConfiguration(defaultConfig, example.name, baseURL, example.sourcePath, example.destPath, example.compress); | ||
webpack(config, function(err, stats){ | ||
@@ -154,0 +154,0 @@ if (err) { |
@@ -14,2 +14,3 @@ #! /usr/bin/env node | ||
.option('-f, --filter [names...]','Filter examples to generate') | ||
.option('-m, --minify', 'Minify examples') | ||
.parse(process.argv); | ||
@@ -33,2 +34,3 @@ | ||
var configuration = require(configFilePath); | ||
var compress = !!program.minify; | ||
@@ -198,3 +200,3 @@ // Variable extraction | ||
if (templateData.examples && configuration.webpack) { | ||
require('./examples.js')(templateData, doneWithProcessing); | ||
require('./examples.js')(templateData, doneWithProcessing, compress); | ||
} else { | ||
@@ -201,0 +203,0 @@ doneWithProcessing(); |
{ | ||
"name": "kw-doc", | ||
"version": "1.0.17", | ||
"version": "1.0.18", | ||
"description": "Static website generator based on Hexo to build developer documentation.", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
348149
2350