Skip to content

Commit

Permalink
chore: release v1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
booxood committed May 4, 2017
1 parent 7fa3700 commit 6fca99e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 27 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "elf-cli",
"version": "1.5.3",
"version": "1.6.0",
"description": "HTML5 boilerplate and build tool",
"scripts": {
"commit": "git-cz",
Expand Down
46 changes: 23 additions & 23 deletions webpack/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,41 +99,41 @@ HeadJavascriptInjectPlugin.prototype.apply = function (compiler) {
})
}

var addOneOrMorePlugins = _.curry(function(pluginClass, plugins, config) {
if (_.isArray(config)) {
Array.prototype.push.apply(plugins, config.map(function (c) {
return new pluginClass(c)
}))
} else {
plugins.push(new pluginClass(config))
}
return plugins
var addOneOrMorePlugins = _.curry(function (pluginClass, plugins, options) {
if (_.isArray(options)) {
Array.prototype.push.apply(plugins, options.map(function (c) {
return new pluginClass(c)
}))
} else {
plugins.push(new pluginClass(options))
}
return plugins
})

var addZeptoPlugin = function(plugins, config) {
plugins.push(new webpack.ProvidePlugin({
$: zeptoPath,
Zepto: zeptoPath,
'window.Zepto': zeptoPath
}))
var addZeptoPlugin = function (plugins, config) {
plugins.push(new webpack.ProvidePlugin({
$: zeptoPath,
Zepto: zeptoPath,
'window.Zepto': zeptoPath
}))
}

var addHtmlWebpackPlugins = addOneOrMorePlugins(HtmlWebpackPlugin)

var addCommonChunkPlugins = addOneOrMorePlugins(webpack.optimize.CommonsChunkPlugin)

var addHeadJsInjectPlugin = function(plugins, config) {
plugins.push(new HeadJavascriptInjectPlugin())
var addHeadJsInjectPlugin = function (plugins, config) {
plugins.push(new HeadJavascriptInjectPlugin())
}

var getPlugins = function (config) {
var plugins = []
var plugins = []

addZeptoPlugin(plugins, config)
addHtmlWebpackPlugins(plugins, config.htmlWebpackPluginOptions)
addCommonChunkPlugins(plugins, config.commonsChunkPluginOptions)
addHeadJsInjectPlugin(plugins, config)
return plugins
addZeptoPlugin(plugins, config)
addHtmlWebpackPlugins(plugins, config.htmlWebpackPluginOptions)
addCommonChunkPlugins(plugins, config.commonsChunkPluginOptions)
addHeadJsInjectPlugin(plugins, config)
return plugins
}

exports.HeadJavascriptInjectPlugin = HeadJavascriptInjectPlugin
Expand Down
5 changes: 2 additions & 3 deletions webpack/webpack.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const {
getPlugins
} = require('./plugins.js')
const allConfig = require('../config/index.js')
const ROOT = process.cwd()

const NODE_ENV = process.env.NODE_ENV || ''
const config = _.merge({}, allConfig, allConfig[NODE_ENV.toUpperCase()])

Expand All @@ -33,8 +33,7 @@ const baseConfig = {
use: [{
loader: 'exports-loader',
options: 'window.$'
},
'script-loader']
}, 'script-loader']
}, {
test: /\.(mp3|mp4|webm|mov|ogg|ogv)(\?\S*)?$/,
use: [{
Expand Down

0 comments on commit 6fca99e

Please sign in to comment.