mirror of
https://github.com/daniel-j/fimfic2epub.git
synced 2024-09-30 00:56:13 +13:00
webpack upgrade
This commit is contained in:
parent
b2717c6ee3
commit
c2234018d7
4 changed files with 29 additions and 34 deletions
|
@ -33,8 +33,7 @@ webpackConfig.forEach((c) => {
|
||||||
minimize: true,
|
minimize: true,
|
||||||
debug: false
|
debug: false
|
||||||
}))
|
}))
|
||||||
c.plugins.push(new webpack.optimize.DedupePlugin())
|
/*
|
||||||
if (c.uglify) {
|
|
||||||
c.plugins.push(new webpack.optimize.UglifyJsPlugin({
|
c.plugins.push(new webpack.optimize.UglifyJsPlugin({
|
||||||
compress: {
|
compress: {
|
||||||
warnings: false,
|
warnings: false,
|
||||||
|
@ -47,7 +46,7 @@ webpackConfig.forEach((c) => {
|
||||||
screw_ie8: true,
|
screw_ie8: true,
|
||||||
sourceMap: !!c.devtool
|
sourceMap: !!c.devtool
|
||||||
}))
|
}))
|
||||||
}
|
*/
|
||||||
}
|
}
|
||||||
c.plugins.push(new webpack.DefinePlugin({
|
c.plugins.push(new webpack.DefinePlugin({
|
||||||
FIMFIC2EPUB_VERSION: JSON.stringify(require('./package.json').version)
|
FIMFIC2EPUB_VERSION: JSON.stringify(require('./package.json').version)
|
||||||
|
|
|
@ -9,7 +9,7 @@ import isNode from 'detect-node'
|
||||||
|
|
||||||
let tidy
|
let tidy
|
||||||
if (!isNode) {
|
if (!isNode) {
|
||||||
tidy = require('exports?tidy_html5!tidy-html5')
|
tidy = require('exports-loader?tidy_html5!tidy-html5')
|
||||||
} else {
|
} else {
|
||||||
tidy = require('tidy-html5').tidy_html5
|
tidy = require('tidy-html5').tidy_html5
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
export let NS = {
|
export const NS = {
|
||||||
OPF: 'http://www.idpf.org/2007/opf',
|
OPF: 'http://www.idpf.org/2007/opf',
|
||||||
OPS: 'http://www.idpf.org/2007/ops',
|
OPS: 'http://www.idpf.org/2007/ops',
|
||||||
DC: 'http://purl.org/dc/elements/1.1/',
|
DC: 'http://purl.org/dc/elements/1.1/',
|
||||||
|
@ -9,7 +9,7 @@ export let NS = {
|
||||||
XLINK: 'http://www.w3.org/1999/xlink'
|
XLINK: 'http://www.w3.org/1999/xlink'
|
||||||
}
|
}
|
||||||
|
|
||||||
export let tidyOptions = {
|
export const tidyOptions = {
|
||||||
'indent': 'auto',
|
'indent': 'auto',
|
||||||
'numeric-entities': 'yes',
|
'numeric-entities': 'yes',
|
||||||
'output-xhtml': 'yes',
|
'output-xhtml': 'yes',
|
||||||
|
@ -22,11 +22,11 @@ export let tidyOptions = {
|
||||||
'show-body-only': 'auto'
|
'show-body-only': 'auto'
|
||||||
}
|
}
|
||||||
|
|
||||||
export let containerXml = `<?xml version="1.0" encoding="UTF-8"?>
|
export const containerXml = `<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container">
|
<container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container">
|
||||||
<rootfiles>
|
<rootfiles>
|
||||||
<rootfile full-path="OEBPS/content.opf" media-type="application/oebps-package+xml"/>
|
<rootfile full-path="OEBPS/content.opf" media-type="application/oebps-package+xml"/>
|
||||||
</rootfiles>
|
</rootfiles>
|
||||||
</container>
|
</container>
|
||||||
`
|
`
|
||||||
export let youtubeKey = 'AIzaSyCF1taix0lTr7-e_XBZazIXfAr8IvxTJhA'
|
export const youtubeKey = 'AIzaSyCF1taix0lTr7-e_XBZazIXfAr8IvxTJhA'
|
||||||
|
|
|
@ -16,10 +16,10 @@ const bundleExtensionConfig = {
|
||||||
},
|
},
|
||||||
|
|
||||||
module: {
|
module: {
|
||||||
loaders: [
|
rules: [
|
||||||
{
|
{
|
||||||
test: /\.js$/,
|
test: /\.js$/,
|
||||||
loader: 'babel',
|
use: 'babel-loader',
|
||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
query: {
|
query: {
|
||||||
sourceMaps: true,
|
sourceMaps: true,
|
||||||
|
@ -28,7 +28,7 @@ const bundleExtensionConfig = {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.styl$/,
|
test: /\.styl$/,
|
||||||
loader: 'raw-loader!stylus-loader'
|
use: ['raw-loader', 'stylus-loader']
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
noParse: [
|
noParse: [
|
||||||
|
@ -37,7 +37,7 @@ const bundleExtensionConfig = {
|
||||||
},
|
},
|
||||||
|
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: ['', '.js', '.json', '.styl'],
|
extensions: ['.js', '.json', '.styl'],
|
||||||
modules: [
|
modules: [
|
||||||
path.resolve('./src'),
|
path.resolve('./src'),
|
||||||
'node_modules'
|
'node_modules'
|
||||||
|
@ -50,9 +50,7 @@ const bundleExtensionConfig = {
|
||||||
externals: ['request', 'tidy-html5'],
|
externals: ['request', 'tidy-html5'],
|
||||||
|
|
||||||
plugins: [],
|
plugins: [],
|
||||||
devtool: 'source-map',
|
devtool: 'source-map'
|
||||||
debug: true,
|
|
||||||
uglify: inProduction
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const bundleNpmModuleConfig = {
|
const bundleNpmModuleConfig = {
|
||||||
|
@ -67,10 +65,10 @@ const bundleNpmModuleConfig = {
|
||||||
target: 'node',
|
target: 'node',
|
||||||
|
|
||||||
module: {
|
module: {
|
||||||
loaders: [
|
rules: [
|
||||||
{
|
{
|
||||||
test: /\.js$/,
|
test: /\.js$/,
|
||||||
loader: 'babel',
|
use: 'babel-loader',
|
||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
query: {
|
query: {
|
||||||
sourceMaps: !inProduction,
|
sourceMaps: !inProduction,
|
||||||
|
@ -79,7 +77,7 @@ const bundleNpmModuleConfig = {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.styl$/,
|
test: /\.styl$/,
|
||||||
loader: 'raw-loader!stylus-loader'
|
use: ['raw-loader', 'stylus-loader']
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
noParse: [
|
noParse: [
|
||||||
|
@ -88,7 +86,7 @@ const bundleNpmModuleConfig = {
|
||||||
},
|
},
|
||||||
|
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: ['', '.js', '.json', '.styl'],
|
extensions: ['.js', '.json', '.styl'],
|
||||||
modules: [
|
modules: [
|
||||||
path.resolve('./src'),
|
path.resolve('./src'),
|
||||||
'node_modules'
|
'node_modules'
|
||||||
|
@ -98,9 +96,7 @@ const bundleNpmModuleConfig = {
|
||||||
externals: [nodeExternals({whitelist: ['es6-event-emitter', /^babel-runtime/]}), 'exports?tidy_html5!tidy-html5'],
|
externals: [nodeExternals({whitelist: ['es6-event-emitter', /^babel-runtime/]}), 'exports?tidy_html5!tidy-html5'],
|
||||||
|
|
||||||
plugins: [],
|
plugins: [],
|
||||||
devtool: 'source-map',
|
devtool: 'source-map'
|
||||||
debug: true,
|
|
||||||
uglify: inProduction
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default [bundleExtensionConfig, bundleNpmModuleConfig]
|
export default [bundleExtensionConfig, bundleNpmModuleConfig]
|
||||||
|
|
Loading…
Reference in a new issue