Skip to content

Commit

Permalink
feat(package): use official releases for f7
Browse files Browse the repository at this point in the history
  • Loading branch information
Pooya Parsa committed Nov 7, 2017
1 parent c586499 commit 09f2d80
Show file tree
Hide file tree
Showing 3 changed files with 406 additions and 386 deletions.
16 changes: 7 additions & 9 deletions lib/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ const defaults = {
const resolvePath = (...args) => resolve(__dirname, ...args)
const resolveDep = p => require.resolve(p)

const PREFIX = '@pi0/'

module.exports = function nuxt7 (moduleOptions) {
const options = defaultsDeep({}, moduleOptions, this.options.framework7, defaults)
const cloneOptions = () => cloneDeep(options)

// mode
// Router Mode
if (options.mode === 'history') {
options.view.pushStateSeparator = '__window.location.origin ? \'\' : \'#\'__'
options.view.pushStateRoot = '__window.location.origin__'
Expand All @@ -45,14 +43,14 @@ module.exports = function nuxt7 (moduleOptions) {
this.extendBuild(config => extendConfig(config, options))

// Force add F7 dependencies to common chunk
this.addVendor(`${PREFIX}framework7`)
this.addVendor(`${PREFIX}framework7-vue`)
this.addVendor(`framework7`)
this.addVendor(`framework7-vue`)
this.addVendor('dom7')
this.addVendor('template7')

// Framework7 css files
if (options.css) {
this.options.css.push(resolveDep(`${PREFIX}framework7/dist/css/framework7${options.rtl ? '.rtl' : ''}.css`))
this.options.css.push(resolveDep(`framework7/dist/css/framework7${options.rtl ? '.rtl' : ''}.css`))
}
delete options.css

Expand Down Expand Up @@ -133,14 +131,14 @@ function extendConfig (config, options) {

// Don't exclude babel for F7 stuff
const babelLoader = config.module.rules.find(r => r.loader === 'babel-loader')
babelLoader.exclude = /node_modules\/(?!(@pi0\/framework7|@pi0\/framework7-vue|template7|dom7)\/).*/
babelLoader.exclude = /node_modules\/(?!(framework7|framework7-vue|template7|dom7)\/).*/

// Disable warning for babel on framework7 dist files
babelLoader.options.compact = false

// framework7
config.resolve.alias['framework7'] = resolveDep(`${PREFIX}framework7/dist/js/framework7.esm.bundle.js`)
config.resolve.alias['framework7'] = resolveDep(`framework7/dist/js/framework7.esm.bundle.js`)

// framework7-vue
config.resolve.alias['framework7-vue'] = resolveDep(`${PREFIX}framework7-vue/dist/framework7-vue.esm.js`)
config.resolve.alias['framework7-vue'] = resolveDep(`framework7-vue/dist/framework7-vue.esm.js`)
}
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
},
"dependencies": {
"@nuxtjs/pwa": "^1.0.2",
"@pi0/framework7": "^2.0.0-beta.9",
"@pi0/framework7-vue": "^2.0.0-beta.1.5",
"framework7": "^2.0.0-beta.15",
"framework7-vue": "^2.0.0-beta.4",
"framework7-icons": "^0.8.9",
"lodash": "^4.17.4",
"nuxt": "^1.0.0-rc11"
Expand All @@ -32,15 +32,15 @@
"lib"
],
"devDependencies": {
"eslint": "^4.8.0",
"eslint": "^4.10.0",
"eslint-config-standard": "^10.2.1",
"eslint-plugin-html": "^3.2.2",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-node": "^5.2.0",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-node": "^5.2.1",
"eslint-plugin-promise": "^3.6.0",
"eslint-plugin-standard": "^3.0.1",
"husky": "^0.14.3",
"lint-staged": "^4.2.3",
"lint-staged": "^4.3.0",
"standard-version": "^4.2.0",
"surge": "^0.19.0"
}
Expand Down
Loading

0 comments on commit 09f2d80

Please sign in to comment.