remove babel on build. browsers support ES6 natively

This commit is contained in:
daniel-j 2016-06-25 21:43:01 +02:00
parent bbba141ef6
commit 99c62e8b9f
5 changed files with 10 additions and 12 deletions

View file

@ -1,4 +1,3 @@
'use strict'
// gulp and utilities // gulp and utilities
import gulp from 'gulp' import gulp from 'gulp'
@ -34,6 +33,7 @@ if (inProduction) {
debug: false debug: false
})) }))
webpackConfig.plugins.push(new webpack.optimize.DedupePlugin()) webpackConfig.plugins.push(new webpack.optimize.DedupePlugin())
/*
webpackConfig.plugins.push(new webpack.optimize.UglifyJsPlugin({ webpackConfig.plugins.push(new webpack.optimize.UglifyJsPlugin({
compress: { compress: {
warnings: false, warnings: false,
@ -46,6 +46,7 @@ if (inProduction) {
screw_ie8: true, screw_ie8: true,
sourceMap: false sourceMap: false
})) }))
*/
} }
let wpCompiler = webpack(Object.assign({}, webpackConfig, { let wpCompiler = webpack(Object.assign({}, webpackConfig, {

View file

@ -5,7 +5,7 @@
"description": "", "description": "",
"author": "djazz", "author": "djazz",
"scripts": { "scripts": {
"pack": "gulp pack -p" "build": "gulp -p"
}, },
"dependencies": { "dependencies": {
"escape-string-regexp": "^1.0.5", "escape-string-regexp": "^1.0.5",
@ -20,9 +20,6 @@
"devDependencies": { "devDependencies": {
"babel-core": "^6.9.1", "babel-core": "^6.9.1",
"babel-loader": "^6.2.4", "babel-loader": "^6.2.4",
"babel-preset-es2015": "^6.9.0",
"babel-preset-es2015-loose": "^7.0.0",
"babel-preset-es2015-loose-native-modules": "^1.0.0",
"babel-preset-node6": "^11.0.0", "babel-preset-node6": "^11.0.0",
"del": "^2.2.0", "del": "^2.2.0",
"exports-loader": "^0.6.3", "exports-loader": "^0.6.3",

View file

@ -1 +0,0 @@
{"presets": ["es2015-loose-native-modules"]}

View file

@ -1,5 +1,5 @@
export const NS = { export let 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 const NS = {
XLINK: 'http://www.w3.org/1999/xlink' XLINK: 'http://www.w3.org/1999/xlink'
} }
export const tidyOptions = { export let tidyOptions = {
'indent': 'auto', 'indent': 'auto',
'numeric-entities': 'yes', 'numeric-entities': 'yes',
'output-xhtml': 'yes', 'output-xhtml': 'yes',
@ -21,13 +21,13 @@ export const tidyOptions = {
'tidy-mark': 'no' 'tidy-mark': 'no'
} }
export const mimeMap = { export let mimeMap = {
'image/jpeg': 'Images/*.jpg', 'image/jpeg': 'Images/*.jpg',
'image/png': 'Images/*.png', 'image/png': 'Images/*.png',
'image/gif': 'Images/*.gif' 'image/gif': 'Images/*.gif'
} }
export const containerXml = `<?xml version="1.0" encoding="UTF-8"?> export let 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="content.opf" media-type="application/oebps-package+xml"/> <rootfile full-path="content.opf" media-type="application/oebps-package+xml"/>

View file

@ -1,8 +1,7 @@
'use strict'
import path from 'path' import path from 'path'
let inProduction = process.env.NODE_ENV === 'production' || process.argv.indexOf('-p') !== -1 // let inProduction = process.env.NODE_ENV === 'production' || process.argv.indexOf('-p') !== -1
export default { export default {
entry: { entry: {
@ -15,11 +14,13 @@ export default {
}, },
module: { module: {
loaders: [ loaders: [
/*
{ {
test: /\.js$/, loader: 'babel', exclude: /node_modules/, query: { test: /\.js$/, loader: 'babel', exclude: /node_modules/, query: {
sourceMaps: inProduction sourceMaps: inProduction
} }
}, },
*/
{ {
test: /\.styl$/, test: /\.styl$/,
loader: 'raw-loader!stylus-loader' loader: 'raw-loader!stylus-loader'