diff --git a/lib/app/app.js b/lib/app/app.js index b0852579fa..1caf8bab12 100644 --- a/lib/app/app.js +++ b/lib/app/app.js @@ -2,10 +2,10 @@ import Vue from 'vue' import Router from 'vue-router' import Content from './Content' import ClientOnly from './ClientOnly' -import NotFound from '~notFound' import dataMixin from './dataMixin' -import { routes } from './.temp/routes' -import { siteData } from './.temp/siteData' +import NotFound from '@notFound' +import { routes } from '@temp/routes' +import { siteData } from '@temp/siteData' // suggest dev server restart on base change if (module.hot) { diff --git a/lib/app/clientEntry.js b/lib/app/clientEntry.js index 145e2fa306..a251cc8c1b 100644 --- a/lib/app/clientEntry.js +++ b/lib/app/clientEntry.js @@ -1,6 +1,6 @@ /* global BASE_URL, GA_ID, ga, SW_ENABLED */ -import './.temp/polyfill' +import '@temp/polyfill' import { createApp } from './app' import { register } from 'register-service-worker' diff --git a/lib/default-theme/Layout.vue b/lib/default-theme/Layout.vue index bf0a0a9868..50562340f9 100644 --- a/lib/default-theme/Layout.vue +++ b/lib/default-theme/Layout.vue @@ -24,7 +24,7 @@ import Home from './Home.vue' import Navbar from './Navbar.vue' import Page from './Page.vue' import Sidebar from './Sidebar.vue' -import { pathToComponentName, getTitle, getLang } from '../app/util' +import { pathToComponentName, getTitle, getLang } from '@app/util' import { resolveSidebarItems } from './util' export default { diff --git a/lib/default-theme/styles/config.styl b/lib/default-theme/styles/config.styl index 82aed1990d..65084e13a5 100644 --- a/lib/default-theme/styles/config.styl +++ b/lib/default-theme/styles/config.styl @@ -14,4 +14,4 @@ $MQNarrow = 959px $MQMobile = 719px $MQMobileNarrow = 419px -@import '../../app/.temp/override.styl' // generated from user config +@import '~@temp/override.styl' // generated from user config diff --git a/lib/prepare.js b/lib/prepare.js index 5783c12333..4ff058ba97 100644 --- a/lib/prepare.js +++ b/lib/prepare.js @@ -249,7 +249,7 @@ async function genRoutesFile ({ siteData: { pages }, sourceDir, pageFiles }) { } return ( - `import Theme from '~theme'\n` + + `import Theme from '@theme'\n` + `export const routes = [${pages.map(genRoute).join(',')}\n]` ) } diff --git a/lib/webpack/createBaseConfig.js b/lib/webpack/createBaseConfig.js index 0d6a95419b..0ea83c411c 100644 --- a/lib/webpack/createBaseConfig.js +++ b/lib/webpack/createBaseConfig.js @@ -34,9 +34,11 @@ module.exports = function createBaseConfig ({ config.resolve .set('symlinks', true) .alias - .set('~theme', themePath) - .set('~notFound', notFoundPath) - .set('~source', sourceDir) + .set('@theme', themePath) + .set('@notFound', notFoundPath) + .set('@source', sourceDir) + .set('@app', path.resolve(__dirname, '../app')) + .set('@temp', path.resolve(__dirname, '../app/.temp')) .end() .extensions .merge(['.js', '.jsx', '.vue', '.json'])