Skip to content

Commit 98e1665

Browse files
committed
feat: allow default theme to be copied as custom theme
1 parent e8d8559 commit 98e1665

File tree

6 files changed

+12
-10
lines changed

6 files changed

+12
-10
lines changed

lib/app/app.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import Vue from 'vue'
22
import Router from 'vue-router'
33
import Content from './Content'
44
import ClientOnly from './ClientOnly'
5-
import NotFound from '~notFound'
65
import dataMixin from './dataMixin'
7-
import { routes } from './.temp/routes'
8-
import { siteData } from './.temp/siteData'
6+
import NotFound from '@notFound'
7+
import { routes } from '@temp/routes'
8+
import { siteData } from '@temp/siteData'
99

1010
// suggest dev server restart on base change
1111
if (module.hot) {

lib/app/clientEntry.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* global BASE_URL, GA_ID, ga, SW_ENABLED */
22

3-
import './.temp/polyfill'
3+
import '@temp/polyfill'
44
import { createApp } from './app'
55
import { register } from 'register-service-worker'
66

lib/default-theme/Layout.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import Home from './Home.vue'
2424
import Navbar from './Navbar.vue'
2525
import Page from './Page.vue'
2626
import Sidebar from './Sidebar.vue'
27-
import { pathToComponentName, getTitle, getLang } from '../app/util'
27+
import { pathToComponentName, getTitle, getLang } from '@app/util'
2828
import { resolveSidebarItems } from './util'
2929
3030
export default {

lib/default-theme/styles/config.styl

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ $MQNarrow = 959px
1414
$MQMobile = 719px
1515
$MQMobileNarrow = 419px
1616

17-
@import '../../app/.temp/override.styl' // generated from user config
17+
@import '~@temp/override.styl' // generated from user config

lib/prepare.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ async function genRoutesFile ({ siteData: { pages }, sourceDir, pageFiles }) {
249249
}
250250

251251
return (
252-
`import Theme from '~theme'\n` +
252+
`import Theme from '@theme'\n` +
253253
`export const routes = [${pages.map(genRoute).join(',')}\n]`
254254
)
255255
}

lib/webpack/createBaseConfig.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ module.exports = function createBaseConfig ({
3434
config.resolve
3535
.set('symlinks', true)
3636
.alias
37-
.set('~theme', themePath)
38-
.set('~notFound', notFoundPath)
39-
.set('~source', sourceDir)
37+
.set('@theme', themePath)
38+
.set('@notFound', notFoundPath)
39+
.set('@source', sourceDir)
40+
.set('@app', path.resolve(__dirname, '../app'))
41+
.set('@temp', path.resolve(__dirname, '../app/.temp'))
4042
.end()
4143
.extensions
4244
.merge(['.js', '.jsx', '.vue', '.json'])

0 commit comments

Comments
 (0)