0.4.0 • Published 7 years ago

qinshixixing-parcel v0.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

qinshixixing-parcel

This is a package for parcel which has some pre-configure.

Installation

npm i -D qinshixixing-parcel

Usage

By command line

For pruduction
qsxx-parcel build
For development
qsxx-parcel watch
For development and start a web service
qsxx-parcel dev

By node.js API

New parcelTask
const QsxxParcel = require('qinshixixing-parcel');
const config = {
    input: ts,
    outputDir: 'dist',
    outputName: 'build.js'
};
const parcelTask = new QsxxParcel(config);
For pruduction
parcelTask.build();
For development
parcelTask.watch();
For development and start a web service
parcelTask.dev();

Configure type

parameter

If you use node.js api and set the options in parameter. Just like the example above.

qsxx-parcel.config.json

If there is a file named "qsxx-parcel.config.json" in the directory which you run node.js(just the same as "process.cwd()"), the content of the file will be the configure.

Options

basePath: string

The root directory of the project.

default value: process.cwd()

updateConfig: boolean

This option is used to set whether to update package.json, .babelrc, .postcssrc and .posthtmlrc.

default value: true
note:

If you have set "qsxx-parcel.config.json" as the configure file, this option will be reset to false after you begin to run the parcel task. If you use node.js api and set the configure in javascript file, it's better to set this option to false by manual.

input: string

The path to the entry file.

default value: 'src/index.html'

outputDir: string

The path to the directory which the output file will be put. The same as the configure 'outDir' of parcel.

default value: 'build'

outputName: string

The name of the output file. The same as the configure 'outFile' of parcel.

default value: The same as the input file name.

cache: boolean

Enabled or disables caching. The same as the configure 'cache' of parcel.

default value: false

publicUrl: string

The url to server on. The same as the configure 'publicUrl' of parcel.

default value: './' or 'devServerDir'
note:

If you are in development mode and starting a web service, the value of this option will be set to 'devServerDir' and you can't change it. In other case, the default value is './' and you can change it by set this option.

target: string

The environment where your project code will run. The following value is valid:

'browser'
'node'
'electron'

The same as the configure 'target' of parcel.

default value: 'browser'
0.4.0

7 years ago

0.3.7

7 years ago

0.3.6

7 years ago

0.3.5

7 years ago

0.3.4

7 years ago

0.3.2

7 years ago

0.3.0

7 years ago

0.2.12

7 years ago

0.2.11

7 years ago

0.2.10

7 years ago

0.2.9

7 years ago

0.2.8

7 years ago

0.2.7

7 years ago

0.2.6

7 years ago

0.2.5-3

7 years ago

0.2.5-2

7 years ago

0.2.5-1

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago