Snowpack Plugin: Acorn Plugin Injection
Table of Contents
This project features a Snowpack plugin that injects Acorn plugins into Snowpack's internal Rollup configuration. This resolves various issues with lack of parser support when bundling a Snowpack project's dependencies.
This project was created as a solution for a StackOverflow post. Relevant topics:
- Snowpack Discussion#1209: "Snowpack doesn't support private class method"
- Snowpack issue#1263: "Snowpack doesn't seem to support private ('hashed') class methods"
This plugin needs to be installed as a Node.js development dependency and configured within a Snowpack configuration. Instructions are included below.
Installing the plugin as a Node.js development dependency can be done with any of the following package managers:
npm install --save-dev snowpack-plugin-acorn-injection
yarn add --dev snowpack-plugin-acorn-injection
||Acorn plugin dependency names to resolve and inject|
Note: Plugins stated in
pluginsmust be resolvable through Node.js'
The plugin can be configured with any of Snowpack's configuration types.
For example, injecting
acorn-stage3 can be done with the following example:
An Important Note: Acorn plugins must be installed separately as development dependencies; this plugin has no transitive Acorn dependencies. In this example,
acorn-stage3is installed as a development dependency in the project.
Licensed under MIT license.