1.3.0 • Published 6 years ago

parcel-plugin-change-file v1.3.0

Weekly downloads
38
License
ISC
Repository
-
Last release
6 years ago

:ambulance: parcel-plugin-change-file

中文文档

:bulb: How ignore parcel bundler file ?

On Parcel build end, change index.html context, and copy static files in outDir

:building_construction: Install

$ yarn add -D parcel-plugin-change-file

:bookmark: Feature1: Exegesis index.html

Add <!--[ your-code ]-->

<body>
  <!--[ <script src="lodash.min.js"></script> ]-->
</bodt>

The lodash.min.js jump to parcel bundler, this build end html:

<body>
  <script src="lodash.min.js"></script>
</bodt>

:lipstick: Feature2: Replace index.html

Add <!-- parcel-plugin-change-file-i --> in index.html

<header>
  <title><!-- parcel-plugin-change-file-0 --></title>
</header>

Create parcel-plugin-change-file.js in project-dir

module.exports = {
  html: ['Product Name'],
};

parcel build end:

<header>
  <title>Product Name</title>
</header>

:truck: Feature3: Copy files to outDir

Create parcel-plugin-change-file.js in project-dir

module.exports = {
  copy: ['src/assets'],
};

:beer: OK, after build, we change static html and files!

File tree like this:

npm.io

:beer: All config

module.exports = {
  timeout: 30, // setTimeout replace Html file
  replaceName: 'parcel-plugin-change-file', // default html replaceName
  html: ['hello'], // change string to html
  copy: ['src/assets'], // copy files in outDir
};

How did ignore parcel-plugin-change-file feature?

Add changeFile=false

$ changeFile=false parcel index.html
1.3.0

6 years ago

1.2.9

6 years ago

1.2.8

6 years ago

1.2.7

6 years ago

1.2.6

6 years ago

1.2.5

6 years ago

1.2.4

6 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.1.8

6 years ago

1.1.7

6 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago