Skip to content

Commit

Permalink
integral updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgeny Metelkin committed May 10, 2019
1 parent 35c68ae commit c76a07f
Show file tree
Hide file tree
Showing 15 changed files with 6,530 additions and 5,915 deletions.
12 changes: 8 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
language: node_js
node_js:
- '6'
- '7'
- '10'
script:
- npm build
- npm run build
- cp dist/sv.zip dist/SbmlViewer-offline-$TRAVIS_TAG.zip
deploy:
provider: releases
api_key:
secure: IjSmOqvybqi8PsPNvDO8sco/dFxShVdyEvBTgdPaPhy+kB0GAqFtzyTDyfDdV7kpnmzZDnqKUtJeUmFY7j2WznOdOyqp4RtGLyVUuGmtAp10uKh72rbvU5ifn+Amk5Td+Qy+9t3NV5L1ZZUDqhc86Mf+C0Y8CpO/G7g8CqR7wniY7AAaN9ZNgRzh1/sKAl5Iyx5ySdVI9H8NOuP7A/mpKgfrARLvdn1cHGFYk+Ev0AOpkLrU3tucg6UlYag31Zom/GR0G0TkMDMKfaakvG2FnDj/pIfhOl4z1qZe0ox7gi44/VvNIqtHsTLz6kFzzCEpOhnxyMx4vRCMtFPWISkZEX8VGOOVZFPLvd9WxQQ/PCQGLLVs5d++P+fwD9GhBAi96V8Cpotrgi68dT6USX14tsRFgGU+KyphvZFfPPZvce6KumXBPizZ/6CbPAMRRLavmu/7KhPywnLsyYzawvZv9NCKHcGRUY5QZ0mWSPQVGYPVuzXR3boCRnkPKDLUlXtu7nN8xMvr1B0CIYoK7uJ+ZtVyaql0N1FiOiRDxxeP5meeT5qwlPm6cMsSoB/KdR7iRPRMNHjU8HTW02xVQwIm+1x0plpOyFH3f1piNgJsYzfRCgzV6FTigOCt5dR3YX4AxFv5JS0dryjnGt9lTKmAWYqdVgnF0FKDHy6h00QgQB4=
file: dist/sv.zip
file: dist/SbmlViewer-offline-$TRAVIS_TAG.zip
skip_cleanup: true
overwrite: true
draft: false
on:
branch: master
tags: true
repo: insysbio/SbmlViewer
node_js: '10'
name: SbmlViewer $TRAVIS_TAG
body: The release includes SbmlViewer offline which can be run locally. Unpack and start index file in browser. *This distributives generated automatically based on $TRAVIS_TAG.*
2 changes: 1 addition & 1 deletion build/webpack.base.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = {
app: './src/main.js'
},
output: {
path: config.build.assetsRoot,
path: process.env.OUTPUT_DEMO || config.build.assetsRoot,
filename: '[name].js',
publicPath: process.env.NODE_ENV === 'production'
? config.build.assetsPublicPath
Expand Down
111 changes: 58 additions & 53 deletions build/webpack.prod.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const ZipPlugin = require('zip-webpack-plugin');

const env = require('../config/prod.env')

const webpackConfig = merge(baseWebpackConfig, {
let prodWebpackConfig = {
module: {
rules: utils.styleLoaders({
sourceMap: config.build.productionSourceMap,
Expand All @@ -31,7 +30,7 @@ const webpackConfig = merge(baseWebpackConfig, {
},
devtool: config.build.productionSourceMap ? config.build.devtool : false,
output: {
path: config.build.assetsRoot,
path: process.env.OUTPUT_DEMO && path.resolve(process.env.OUTPUT_DEMO) || config.build.assetsRoot,
filename: utils.assetsPath('js/[name].js'),
chunkFilename: utils.assetsPath('js/[id].js')
},
Expand Down Expand Up @@ -98,57 +97,63 @@ const webpackConfig = merge(baseWebpackConfig, {
to: config.build.assetsSubDirectory,
ignore: ['.*']
}
]),
new ZipPlugin({
// OPTIONAL: defaults to the Webpack output path (above)
// can be relative (to Webpack output path) or absolute
path: '../',
// OPTIONAL: defaults to the Webpack output filename (above) or,
// if not present, the basename of the path
filename: 'sv.zip',

// OPTIONAL: defaults to 'zip'
// the file extension to use instead of 'zip'
extension: 'zip',

// OPTIONAL: defaults to the empty string
// the prefix for the files included in the zip file
//pathPrefix: 'relative/path',
// OPTIONAL: defaults to the identity function
// a function mapping asset paths to new paths
pathMapper: function(assetPath) {
// put all pngs in an `images` subdir
if (assetPath.endsWith('.png'))
return path.join(path.dirname(assetPath), 'images', path.basename(assetPath));
return assetPath;
},

// OPTIONAL: defaults to including everything
// can be a string, a RegExp, or an array of strings and RegExps
include: [/\.js$/, /\.html$/, /\.css$/],

// OPTIONAL: defaults to excluding nothing
// can be a string, a RegExp, or an array of strings and RegExps
// if a file matches both include and exclude, exclude takes precedence
//exclude: [/\.png$/, /\.html$/],

// yazl Options

// OPTIONAL: see https://github.com/thejoshwolfe/yazl#addfilerealpath-metadatapath-options
fileOptions: {
mtime: new Date(),
mode: 0o100664,
compress: true,
forceZip64Format: false,
},

// OPTIONAL: see https://github.com/thejoshwolfe/yazl#endoptions-finalsizecallback
zipOptions: {
forceZip64Format: false,
},
})
])

]
})
};

if(!process.env.OUTPUT_DEMO) {
prodWebpackConfig.plugins.push(new ZipPlugin({
// OPTIONAL: defaults to the Webpack output path (above)
// can be relative (to Webpack output path) or absolute
path: '../',
// OPTIONAL: defaults to the Webpack output filename (above) or,
// if not present, the basename of the path
filename: 'sv.zip',

// OPTIONAL: defaults to 'zip'
// the file extension to use instead of 'zip'
extension: 'zip',

// OPTIONAL: defaults to the empty string
// the prefix for the files included in the zip file
//pathPrefix: 'relative/path',
// OPTIONAL: defaults to the identity function
// a function mapping asset paths to new paths
pathMapper: function(assetPath) {
// put all pngs in an `images` subdir
if (assetPath.endsWith('.png'))
return path.join(path.dirname(assetPath), 'images', path.basename(assetPath));
return assetPath;
},

// OPTIONAL: defaults to including everything
// can be a string, a RegExp, or an array of strings and RegExps
include: [/\.js$/, /\.html$/, /\.css$/],

// OPTIONAL: defaults to excluding nothing
// can be a string, a RegExp, or an array of strings and RegExps
// if a file matches both include and exclude, exclude takes precedence
//exclude: [/\.png$/, /\.html$/],

// yazl Options

// OPTIONAL: see https://github.com/thejoshwolfe/yazl#addfilerealpath-metadatapath-options
fileOptions: {
mtime: new Date(),
mode: 0o100664,
compress: true,
forceZip64Format: false,
},

// OPTIONAL: see https://github.com/thejoshwolfe/yazl#endoptions-finalsizecallback
zipOptions: {
forceZip64Format: false,
},
}))
}

const webpackConfig = merge(baseWebpackConfig, prodWebpackConfig)

if (config.build.productionGzip) {
const CompressionWebpackPlugin = require('compression-webpack-plugin')
Expand Down
Loading

0 comments on commit c76a07f

Please sign in to comment.