This repository was archived by the owner on May 8, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 13 files changed +21
-23
lines changed
Expand file tree Collapse file tree 13 files changed +21
-23
lines changed Original file line number Diff line number Diff line change 11'use strict'
22
33const paths = require ( './paths' )
4- const path = require ( 'path' )
54// style files regexes
65const MiniCssExtractPlugin = require ( 'mini-css-extract-plugin' )
76const getStyleLoaders = require ( './util' ) . getStyleLoaders
@@ -106,7 +105,7 @@ module.exports = {
106105 mode : process . env . NODE_ENV ,
107106 resolve : {
108107 alias : {
109- '@' : path . resolve ( __dirname , '../web' )
108+ '@' : paths . appSrc
110109 } ,
111110 extensions : paths . moduleFileExtensions
112111 . map ( ext => `.${ ext } ` )
Original file line number Diff line number Diff line change 11'use strict'
22
33const paths = require ( './paths' )
4- const path = require ( 'path' )
54// style files regexes
65const MiniCssExtractPlugin = require ( 'mini-css-extract-plugin' )
76const getStyleLoaders = require ( './util' ) . getStyleLoaders
@@ -98,7 +97,7 @@ module.exports = {
9897 mode : process . env . NODE_ENV ,
9998 resolve : {
10099 alias : {
101- '@' : path . resolve ( __dirname , '../web' )
100+ '@' : paths . appSrc
102101 } ,
103102 extensions : paths . moduleFileExtensions
104103 . map ( ext => `.${ ext } ` )
Original file line number Diff line number Diff line change 11'use strict'
22
33const paths = require ( './paths' )
4- const path = require ( 'path' )
54// style files regexes
65const MiniCssExtractPlugin = require ( 'mini-css-extract-plugin' )
76const getCSSModuleLocalIdent = require ( 'react-dev-utils/getCSSModuleLocalIdent' )
@@ -98,7 +97,7 @@ module.exports = {
9897 mode : process . env . NODE_ENV ,
9998 resolve : {
10099 alias : {
101- '@' : path . resolve ( __dirname , '../web' )
100+ '@' : paths . appSrc
102101 } ,
103102 extensions : paths . moduleFileExtensions
104103 . map ( ext => `.${ ext } ` )
Original file line number Diff line number Diff line change 11{
22 "name" : " ssr-with-js" ,
3- "version" : " 2.1.4 " ,
3+ "version" : " 2.1.5 " ,
44 "dependencies" : {
55 "egg" : " ^2.21.0" ,
66 "egg-scripts" : " ^2.11.0" ,
Original file line number Diff line number Diff line change 11'use strict'
22
33const paths = require ( './paths' )
4- const path = require ( 'path' )
54// style files regexes
65const MiniCssExtractPlugin = require ( 'mini-css-extract-plugin' )
76const getStyleLoaders = require ( './util' ) . getStyleLoaders
@@ -98,7 +97,7 @@ module.exports = {
9897 mode : process . env . NODE_ENV ,
9998 resolve : {
10099 alias : {
101- '@' : path . resolve ( __dirname , '../web' )
100+ '@' : paths . appSrc
102101 } ,
103102 extensions : paths . moduleFileExtensions
104103 . map ( ext => `.${ ext } ` )
Original file line number Diff line number Diff line change 11'use strict'
22
33const paths = require ( './paths' )
4- const path = require ( 'path' )
54// style files regexes
65const MiniCssExtractPlugin = require ( 'mini-css-extract-plugin' )
76const getStyleLoaders = require ( './util' ) . getStyleLoaders
@@ -101,7 +100,7 @@ module.exports = {
101100 mode : process . env . NODE_ENV ,
102101 resolve : {
103102 alias : {
104- '@' : path . resolve ( __dirname , '../web' )
103+ '@' : paths . appSrc
105104 } ,
106105 extensions : paths . moduleFileExtensions
107106 . map ( ext => `.${ ext } ` )
Original file line number Diff line number Diff line change 11'use strict'
22
33const paths = require ( './paths' )
4- const path = require ( 'path' )
54// style files regexes
65const MiniCssExtractPlugin = require ( 'mini-css-extract-plugin' )
76const getCSSModuleLocalIdent = require ( 'react-dev-utils/getCSSModuleLocalIdent' )
@@ -97,7 +96,7 @@ module.exports = {
9796 mode : process . env . NODE_ENV ,
9897 resolve : {
9998 alias : {
100- '@' : path . resolve ( __dirname , '../web' )
99+ '@' : paths . appSrc
101100 } ,
102101 extensions : paths . moduleFileExtensions
103102 . map ( ext => `.${ ext } ` )
Original file line number Diff line number Diff line change 11{
22 "name" : " ssr-with-ts" ,
3- "version" : " 2.0.3 " ,
3+ "version" : " 2.0.4 " ,
44 "description" : " ykfe" ,
55 "dependencies" : {
66 "egg-scripts" : " ^2.10.0" ,
Original file line number Diff line number Diff line change 11{
22 "name" : " yk-cli" ,
3- "version" : " 2.8.5 " ,
3+ "version" : " 2.8.6 " ,
44 "description" : " ykcli for ssr" ,
55 "main" : " ./lib/index.js" ,
66 "module" : " ./es/index.js" ,
Original file line number Diff line number Diff line change 22import { mkdir } from 'shelljs'
33import webpack from 'webpack'
44import fs from 'fs'
5+ import { join } from 'path'
56import { webpackWithPromise } from './util'
67import { Argv } from './interface/argv'
78
@@ -61,6 +62,7 @@ const dev = async (argv?: Argv) => {
6162}
6263
6364const build = async ( ) => {
65+ const outputPath = clientConfig . output . path
6466 const stream = await renderLayout ( )
6567 ora . start ( )
6668 const stats : any = await webpackWithPromise ( clientConfig )
@@ -74,12 +76,12 @@ const build = async () => {
7476 } ) )
7577 let writeStream
7678 try {
77- fs . statSync ( cwd + '/dist/ index.html')
78- writeStream = fs . createWriteStream ( cwd + '/dist/ index.html')
79+ fs . statSync ( join ( outputPath , './ index.html') )
80+ writeStream = fs . createWriteStream ( join ( outputPath , './ index.html') )
7981 stream . pipe ( writeStream )
8082 } catch ( error ) {
81- mkdir ( cwd + '/dist' )
82- writeStream = fs . createWriteStream ( cwd + '/dist/ index.html')
83+ mkdir ( join ( outputPath ) )
84+ writeStream = fs . createWriteStream ( join ( outputPath , './ index.html') )
8385 stream . pipe ( writeStream )
8486 }
8587 ora . succeed ( )
You can’t perform that action at this time.
0 commit comments