piral-samples / piral-webpack-sample

Example for building and debugging a pilet and a Piral instance with webpack. :rocket:

Home Page:https://docs.piral.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Piral Logo

Piral Webpack Sample

⚡ These examples show how to use Piral with Webpack, specifically the piral-cli-webpack plugin.

You can visit this demo at webpack.samples.piral.cloud/.

We have two folders.

sample-pilet

Shows how a standard pilet is debugged and build using Webpack.

After scaffolding we installed piral-cli-webpack:

npm i piral-cli-webpack --save-dev

We've updated the start and build npm tasks to use pilet debug-wp and pilet build-wp respectively.

Besides the change of the two commands we also show here how to publish a pilet in one command:

npm run publish

Which just uses the following commands:

 # cleanup first
rm -rf dist
# also remove old tgz files
rm -f *.tgz
# build it (using webpack!)
npm run build
# pack it using the Piral CLI
pilet pack
# publish the last packed file
pilet publish --url https://feed.piral.cloud/api/v1/pilet/empty --api-key is-invalid-anyway

sample-piral-instance

Shows how a Piral instance is debugged and build using Webpack.

After scaffolding we installed piral-cli-webpack. Since the Piral instance also used Sass for the stylesheet we had to install node-sass, too:

npm i piral-cli-webpack node-sass --save-dev

We've updated the start and build npm tasks to use piral debug-wp and piral build-wp respectively.

License

Piral and this sample code is released using the MIT license. For more information see the license file.

About

Example for building and debugging a pilet and a Piral instance with webpack. :rocket:

https://docs.piral.io

License:MIT License


Languages

Language:TypeScript 52.7%Language:SCSS 33.2%Language:JavaScript 9.0%Language:HTML 5.0%