Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pro-vision/pv-scripts

Package Overview
Dependencies
Maintainers
5
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pro-vision/pv-scripts

CLI for zero configuration frontend-toolchain setup.

  • 2.0.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
5
Created
Source

pv-scripts

CLI for zero configuration frontend-toolchain setup.

Installation

npm i @pro-vision/pv-scripts -D

Usage

Requirements

To use the CLI, you need to create at least the two entry-files (jsEntry, jsLegacyEntry), see [Basic Configuration](#Basic Configuration)).

Command Line Interface

Installing this package gives you the CLI pv-scripts. It can be used with the parameters dev and prod.

To run a locally installed version of the pv-scripts, you can either call the pv-scripts command directly from your local node_modules/.bin folder or by using npx.

npx pv-scripts dev

dev: Transpiles and bundles your code (JS/TS/JSX/TSX/SCSS) via webpack (+ all needed loaders) and opens a webpack-dev-server on the configured port (default: 8616).

prod: Transpiles and bundles your code (JS/TS/JSX/TSX/SCSS) via webpack (+ all needed loaders) and writes them to your target folder.

Configuration

Basic Configuration

Basic Configuration can be done in a pv.config.js file in the npm project root-folder. Possible configuration values are:

keytypedefaultusage
devServerPortnumber8616set webpack-dev-server port
destPathstring"target"defines where to put bundled files
namespacestringthis controlls the name-prexix on your bundled files follwing this pattern `[namespace].app.[?legacy].(js
jsEntrystring"src/index.ts"defines path of your (JS|TS|JSX|TSX) entry file
jsLegacyEntrystring"src/legacyIndex.ts"defines path of your (JS|TS|JSX|TSX) legacy entry file
cssEntrystring"src/index.scss"defines path of your SCSS entry file. If src/index.scss does not exist, no error is thrown but the css generation is simply skipped
useTSbooleantruedefines whether you want to use Typescript
useReactbooleanfalsedefines whether you want to use React
hbsEntrystringdefines path of your handlebars entry file
hbsTargetstringdefines path to your handlebars target file
hbsPartialDirstringdefines path to your a handlebars partials directory
copyStaticFilesbooleanfalsedefines whether content of /static should be copied to target
cleanDestbooleanfalsedefines whether the destination folder should be cleaned before every pv-scripts run
fontsSrcstring"resources/fonts/"defines folder in which the fonts are located
resourcesSrcstring"resources"defines resources folder which is copied to target/resources
Example:
// pv.config.js
module.exports = {
  devServerPort: 8616,
  destPath: "target",
  jsEntry: "src/index.js",
  jsLegacyEntry: "src/index.js",
  cssEntry: "src/index.scss",
  useTS: false,
  useReact: false,
  copyStaticFiles: false
};

Further Configurations

For further customization of the webpack-config, specific config-files can be added to the npm project root-folder.

webpack.config.js: Valid webpack.config file which will be merged with both (dev/prod) default configs.

webpack.config.module.js: Valid webpack.config file which will be merged with the module build of both (dev/prod) default configs.

webpack.config.legacy.js: Valid webpack.config file which will be merged with the legacy build of both (dev/prod) default configs.

webpack.config.dev.js: Valid webpack.config file which will be merged with the dev default config.

webpack.config.dev.module.js: Valid webpack.config file which will be merged with the module build of the dev default config.

webpack.config.dev.legacy.js: Valid webpack.config file which will be merged with the legacy build of the dev default config.

webpack.config.prod.js: Valid webpack.config file which will be merged with the prod default config.

webpack.config.prod.module.js: Valid webpack.config file which will be merged with the module build of the prod default config.

webpack.config.prod.legacy.js: Valid webpack.config file which will be merged with the legacy build of the prod default config.

Examples

You can find example projects in the examples folder:

  • React with TypeScript: react-tsx

FAQs

Package last updated on 27 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc