mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-24 22:50:34 +03:00
chore: exclude ssr from webpack
This commit is contained in:
@@ -36,6 +36,7 @@
|
|||||||
"vue-loader": "^15.6.4",
|
"vue-loader": "^15.6.4",
|
||||||
"vue-meta": "^1.5.8",
|
"vue-meta": "^1.5.8",
|
||||||
"vue-router": "^3.0.2",
|
"vue-router": "^3.0.2",
|
||||||
|
"vue-server-renderer": "^2.6.8",
|
||||||
"vue-template-compiler": "^2.6.6",
|
"vue-template-compiler": "^2.6.6",
|
||||||
"vuex": "^3.1.0",
|
"vuex": "^3.1.0",
|
||||||
"webpack": "^4.29.5",
|
"webpack": "^4.29.5",
|
||||||
|
|||||||
+7
-5
@@ -17,11 +17,13 @@ app.use(webpackDevMiddleware(webpack(WebpackConfig), {
|
|||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|
||||||
fs.readdirSync(__dirname).forEach((file) => {
|
fs.readdirSync(__dirname)
|
||||||
if (fs.statSync(path.join(__dirname, file)).isDirectory()) {
|
.filter(file => file !== 'ssr')
|
||||||
app.use(rewrite('/' + file + '/*', '/' + file + '/index.html'))
|
.forEach((file) => {
|
||||||
}
|
if (fs.statSync(path.join(__dirname, file)).isDirectory()) {
|
||||||
})
|
app.use(rewrite('/' + file + '/*', '/' + file + '/index.html'))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
app.use(express.static(__dirname))
|
app.use(express.static(__dirname))
|
||||||
|
|
||||||
|
|||||||
@@ -7,14 +7,16 @@ import VueLoaderPlugin from 'vue-loader/lib/plugin'
|
|||||||
export default {
|
export default {
|
||||||
devtool: 'inline-source-map',
|
devtool: 'inline-source-map',
|
||||||
mode: 'development',
|
mode: 'development',
|
||||||
entry: fs.readdirSync(__dirname).reduce((entries, dir) => {
|
entry: fs.readdirSync(__dirname)
|
||||||
const fullDir = path.join(__dirname, dir)
|
.filter(entry => entry !== 'ssr')
|
||||||
const entry = path.join(fullDir, 'app.js')
|
.reduce((entries, dir) => {
|
||||||
if (fs.statSync(fullDir).isDirectory() && fs.existsSync(entry)) {
|
const fullDir = path.join(__dirname, dir)
|
||||||
entries[dir] = entry
|
const entry = path.join(fullDir, 'app.js')
|
||||||
}
|
if (fs.statSync(fullDir).isDirectory() && fs.existsSync(entry)) {
|
||||||
return entries
|
entries[dir] = entry
|
||||||
}, {}),
|
}
|
||||||
|
return entries
|
||||||
|
}, {}),
|
||||||
output: {
|
output: {
|
||||||
path: path.join(__dirname, '__build__'),
|
path: path.join(__dirname, '__build__'),
|
||||||
filename: '[name].js',
|
filename: '[name].js',
|
||||||
|
|||||||
Reference in New Issue
Block a user