Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ node_modules
build
# editor config
.vscode
.idea
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ node_modules
# version control
.git
# editor config
.vscode
.vscode
.idea
20 changes: 10 additions & 10 deletions bin/mdss-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ async function build (program) {

// Command line options
const options = {
dev: program.dev || false,
dev: program.opts().dev || false,
target: {
bundle: program.all || program.bundle,
screen: program.all || program.screen,
print: program.all || program.print
bundle: program.opts().all || program.opts().bundle,
screen: program.opts().all || program.opts().screen,
print: program.opts().all || program.opts().print
},
bundle: {
screen: !program.withoutScreen,
print: !program.withoutPrint
screen: !program.opts().withoutScreen,
print: !program.opts().withoutPrint
}
}

Expand All @@ -50,8 +50,8 @@ async function build (program) {

// Configuration
const config = {
configPath: program.configPath || defaultConfigPath,
outputPath: program.outputPath || defaultOutputPath
configPath: program.opts().configPath || defaultConfigPath,
outputPath: program.opts().outputPath || defaultOutputPath
}

try {
Expand Down Expand Up @@ -86,7 +86,7 @@ async function build (program) {
console.log(`Output Dir:\t ${config.outputPath}\n`)

// Building
mkdir(config.outputAbsolutePath)
mkdir.sync(config.outputAbsolutePath)

for (const target of targets) {
const media = (target === 'bundle') ? bundle : target
Expand Down Expand Up @@ -117,7 +117,7 @@ async function build (program) {
console.log(`[CREATE] ${outputFilePath}.map`)
await write(outputFilePath + '.map', result.map)
} else {
const minified = csso.minify(result.css)
const minified = csso.minify(result.css.toString())
await write(outputFilePath, minified.css)
}
}
Expand Down
Loading