diff --git a/gulpfile.babel.js b/gulpfile.babel.js index 8966eb6..91e5ce2 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -33,21 +33,20 @@ webpackConfig.forEach((c) => { minimize: true, debug: false })) - c.plugins.push(new webpack.optimize.DedupePlugin()) - if (c.uglify) { - c.plugins.push(new webpack.optimize.UglifyJsPlugin({ - compress: { - warnings: false, - screw_ie8: true - }, - comments: false, - mangle: { - screw_ie8: true - }, - screw_ie8: true, - sourceMap: !!c.devtool - })) - } + /* + c.plugins.push(new webpack.optimize.UglifyJsPlugin({ + compress: { + warnings: false, + screw_ie8: true + }, + comments: false, + mangle: { + screw_ie8: true + }, + screw_ie8: true, + sourceMap: !!c.devtool + })) + */ } c.plugins.push(new webpack.DefinePlugin({ FIMFIC2EPUB_VERSION: JSON.stringify(require('./package.json').version) diff --git a/src/cleanMarkup.js b/src/cleanMarkup.js index 12f16b1..032d3e9 100644 --- a/src/cleanMarkup.js +++ b/src/cleanMarkup.js @@ -9,7 +9,7 @@ import isNode from 'detect-node' let tidy if (!isNode) { - tidy = require('exports?tidy_html5!tidy-html5') + tidy = require('exports-loader?tidy_html5!tidy-html5') } else { tidy = require('tidy-html5').tidy_html5 } diff --git a/src/constants.js b/src/constants.js index 49f5b12..b502688 100644 --- a/src/constants.js +++ b/src/constants.js @@ -1,5 +1,5 @@ -export let NS = { +export const NS = { OPF: 'http://www.idpf.org/2007/opf', OPS: 'http://www.idpf.org/2007/ops', DC: 'http://purl.org/dc/elements/1.1/', @@ -9,7 +9,7 @@ export let NS = { XLINK: 'http://www.w3.org/1999/xlink' } -export let tidyOptions = { +export const tidyOptions = { 'indent': 'auto', 'numeric-entities': 'yes', 'output-xhtml': 'yes', @@ -22,11 +22,11 @@ export let tidyOptions = { 'show-body-only': 'auto' } -export let containerXml = ` +export const containerXml = ` ` -export let youtubeKey = 'AIzaSyCF1taix0lTr7-e_XBZazIXfAr8IvxTJhA' +export const youtubeKey = 'AIzaSyCF1taix0lTr7-e_XBZazIXfAr8IvxTJhA' diff --git a/webpack.config.babel.js b/webpack.config.babel.js index 1d71bce..ae65ddf 100644 --- a/webpack.config.babel.js +++ b/webpack.config.babel.js @@ -16,10 +16,10 @@ const bundleExtensionConfig = { }, module: { - loaders: [ + rules: [ { test: /\.js$/, - loader: 'babel', + use: 'babel-loader', exclude: /node_modules/, query: { sourceMaps: true, @@ -28,7 +28,7 @@ const bundleExtensionConfig = { }, { test: /\.styl$/, - loader: 'raw-loader!stylus-loader' + use: ['raw-loader', 'stylus-loader'] } ], noParse: [ @@ -37,7 +37,7 @@ const bundleExtensionConfig = { }, resolve: { - extensions: ['', '.js', '.json', '.styl'], + extensions: ['.js', '.json', '.styl'], modules: [ path.resolve('./src'), 'node_modules' @@ -50,9 +50,7 @@ const bundleExtensionConfig = { externals: ['request', 'tidy-html5'], plugins: [], - devtool: 'source-map', - debug: true, - uglify: inProduction + devtool: 'source-map' } const bundleNpmModuleConfig = { @@ -67,10 +65,10 @@ const bundleNpmModuleConfig = { target: 'node', module: { - loaders: [ + rules: [ { test: /\.js$/, - loader: 'babel', + use: 'babel-loader', exclude: /node_modules/, query: { sourceMaps: !inProduction, @@ -79,7 +77,7 @@ const bundleNpmModuleConfig = { }, { test: /\.styl$/, - loader: 'raw-loader!stylus-loader' + use: ['raw-loader', 'stylus-loader'] } ], noParse: [ @@ -88,7 +86,7 @@ const bundleNpmModuleConfig = { }, resolve: { - extensions: ['', '.js', '.json', '.styl'], + extensions: ['.js', '.json', '.styl'], modules: [ path.resolve('./src'), 'node_modules' @@ -98,9 +96,7 @@ const bundleNpmModuleConfig = { externals: [nodeExternals({whitelist: ['es6-event-emitter', /^babel-runtime/]}), 'exports?tidy_html5!tidy-html5'], plugins: [], - devtool: 'source-map', - debug: true, - uglify: inProduction + devtool: 'source-map' } export default [bundleExtensionConfig, bundleNpmModuleConfig]