-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
230 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env node | ||
process.env.NODE_ENV = process.env.NODE_ENV || 'development' | ||
process.env.SPRITE = true | ||
|
||
const argv = require('./utils').getArgv() | ||
|
||
require('../dist/build-svg').start(argv) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { BuildService } from '@types' | ||
import consola from 'consola' | ||
import { svgBuild } from 'src/build' | ||
import { simpleInitConfig } from 'src/utils' | ||
|
||
async function buildMain(argv: BuildService.parsedArgs) { | ||
consola.ready(`@bestminr/build-svg v${argv.version}`) | ||
consola.start('start with SPRITE mode') | ||
const options = await simpleInitConfig(argv, 'svg') | ||
|
||
svgBuild() | ||
|
||
// const webpack: any = options.webpack | ||
// const svgConfig = webpack.svg | ||
// console.log('-------------------------------------') | ||
// console.log('svgConfig', JSON.stringify(svgConfig, null, 2)) | ||
// console.log('-------------------------------------') | ||
// delete options.webpack | ||
// console.log('options', JSON.stringify(options, null, 2)) | ||
// console.log('-------------------------------------') | ||
} | ||
|
||
export { buildMain as start } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import merge from 'webpack-merge' | ||
import { getCommonBaseConfig } from './webpack.base.config' | ||
import consola from 'consola' | ||
|
||
import { ConfigOptions } from '@types' | ||
|
||
export function getSvgConfig(options: ConfigOptions.options) { | ||
if (!(options.webpack && options.webpack.mode)) { | ||
consola.fatal( | ||
'[getSvgConfig] options.webpack or options.webpack.mode is undefined' | ||
) | ||
return process.exit(1) | ||
} | ||
if (options.webpack.svg) { | ||
const svg = options.webpack.svg.webpack || options.webpack.svg || {} | ||
const mode = options.webpack.mode || 'production' | ||
const base: any = options.webpack ? options.webpack.base || {} : {} | ||
return (merge as any)( | ||
getCommonBaseConfig(options), | ||
{ | ||
name: 'svg', | ||
mode, | ||
devtool: false, | ||
output: base.output, | ||
resolve: base.resolve | ||
}, | ||
svg | ||
) | ||
} else { | ||
consola.fatal( | ||
'[getServerConfig] options.webpack.svg is undefined' | ||
) | ||
return process.exit(1) | ||
} | ||
} |
Oops, something went wrong.