Skip to content

Commit

Permalink
chore: Slightly improved build speed
Browse files Browse the repository at this point in the history
  • Loading branch information
rstoenescu committed Jan 17, 2017
1 parent 6bb85bb commit 365f319
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
13 changes: 3 additions & 10 deletions build/script.build.javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ var
uglify = require('uglify-js'),
babel = require('rollup-plugin-babel'),
string = require('rollup-plugin-string'),
json = require('rollup-plugin-json'),
vue = require('rollup-plugin-vue'),
nonStandalone = process.argv[2] === 'simple' || process.argv[3] === 'simple',
version = process.env.VERSION || require('../package.json').version,
file,
banner =
'/*!\n' +
' * Quasar Framework v' + version + '\n' +
Expand All @@ -37,17 +37,10 @@ var
},
rollupConfig = {
entry: 'src/index.js',
plugins: [vue(vueConfig), string(stringConfig), babel(babelConfig)],
plugins: [json(), vue(vueConfig), string(stringConfig), babel(babelConfig)],
external: external
}

'index index.es6'.split(' ').forEach(function (name) { // eslint-disable-line
file = fs
.readFileSync('src/' + name + '.js', 'utf-8')
.replace(/version: '[\d\.]+'/, "version: '" + version + "'")
fs.writeFileSync('src/' + name + '.js', file)
})

// CommonJS build.
rollup
.rollup(rollupConfig)
Expand All @@ -64,7 +57,7 @@ rollup
return rollup
.rollup({
entry: 'src/index.es6.js',
plugins: [vue(vueConfig), string(stringConfig)],
plugins: [json(), vue(vueConfig), string(stringConfig)],
external: external
})
.then(function (bundle) {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"roboto-fontface": "^0.6.0",
"rollup": "^0.37.0",
"rollup-plugin-babel": "^2.6.1",
"rollup-plugin-json": "^2.1.0",
"rollup-plugin-string": "^2.0.2",
"rollup-plugin-vue": "2.2.14",
"shelljs": "^0.7.0",
Expand Down
3 changes: 2 additions & 1 deletion src/index.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import install from './vue-install'
import start from './start'
import standaloneInstall from './standalone-install'
import * as theme from './features/theme'
import { version } from '../package.json'

import './features/body-classes'
import './features/polyfills'
Expand All @@ -23,7 +24,7 @@ import Utils from './utils'
import { LocalStorage, SessionStorage } from './features/web-storage'

let Quasar = {
version: '0.13.0',
version,
install,
start,
theme
Expand Down
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import install from './vue-install'
import start from './start'
import standaloneInstall from './standalone-install'
import * as theme from './features/theme'
import { version } from '../package.json'

import './features/body-classes'
import './features/polyfills'
Expand All @@ -23,7 +24,7 @@ import Utils from './utils'
import { LocalStorage, SessionStorage } from './features/web-storage'

let Quasar = {
version: '0.13.0',
version,
install,
start,
theme,
Expand Down
2 changes: 2 additions & 0 deletions src/vue-install.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Platform from './features/platform'
import { install as eventsInstall } from './features/events'
import { install as toastInstall } from './components/toast/toast'
import { current as theme } from './features/theme'
import { version } from '../package.json'

import Transition from './vue-transitions/index'

Expand Down Expand Up @@ -156,6 +157,7 @@ export default function (_Vue) {
toastInstall(_Vue)

_Vue.prototype.$quasar = {
version,
platform: Platform,
theme
}
Expand Down

0 comments on commit 365f319

Please sign in to comment.