Skip to content

Commit

Permalink
modify assets
Browse files Browse the repository at this point in the history
  • Loading branch information
matianfu-wisnuc committed Sep 4, 2017
1 parent b4833ce commit 781a0c9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
13 changes: 5 additions & 8 deletions assets.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
var path = require('path')
var fs = require('fs')
var mkdirp = require('mkdirp')
const path = require('path')
const fs = require('fs')
const mkdirp = require('mkdirp')

let xxhashBase64, xxhash, xattrBase64, xattr, bundlejs, indexHtml, robotoCSS, styleCSS,
robotoThinBase64, robotoThin, robotoLightBase64, robotoLight,
robotoRegularBase64, robotoRegular, robotoMediumBase64, robotoMedium,
robotoBoldBase64, robotoBold, robotoBlackBase64, robotoBlack, faviconBase64, favicon
let xxhashBase64, xxhash, xattrBase64, xattr

if (global.WEBPACK) {
xxhashBase64 = require('raw-loader!./assets/xxhash.node.base64')
Expand Down Expand Up @@ -42,4 +39,4 @@ if (xattrBase64) {

console.log('assets loaded')

setTimeout(() => require('./src/app'), 1000)
require('./src/app')
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"sinon": "^3.2.1",
"sloc": "^0.2.0",
"supertest": "^3.0.0",
"uglifyjs-webpack-plugin": "^0.4.6",
"webpack": "^3.5.5"
}
}
13 changes: 12 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const fs = require('fs')
const webpack = require('webpack')
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')

module.exports = {

Expand All @@ -19,8 +20,17 @@ module.exports = {
},

externals: {
// "../build/Release/hash": `commonjs ./bin/xxhash.node`,
"../build/Release/hash": `commonjs ./bin/xxhash.node`,
"./build/Release/xattr": `commonjs ./bin/xattr.node`,
"./build/Release/bcrypt": `commonjs ./bin/bcrypt.node`,
"./build/Release/crypt3": `commonjs ./bin/crypt3.node`,
'./build/Release/crypt3async': `commonjs ./bin/crypt3async.node`,
'bcrypt': 'bcrypt',
'ws': 'ws',
'bindings': 'bindings',
'colors': 'colors',
'express': 'express'
},

module: {
Expand Down Expand Up @@ -49,7 +59,8 @@ module.exports = {

plugins: [
new webpack.DefinePlugin({ "global.GENTLY": false }),
new webpack.DefinePlugin({ "global.WEBPACK": true })
new webpack.DefinePlugin({ "global.WEBPACK": true }),
// new UglifyJSPlugin(),
],
}

0 comments on commit 781a0c9

Please sign in to comment.