@@ -13,6 +13,7 @@ import json from "@rollup/plugin-json"
1313import cssOnly from "rollup-plugin-css-only"
1414import babel from "@rollup/plugin-babel"
1515import { wasm } from "@rollup/plugin-wasm"
16+ import { asc } from "rollup-plugin-assemblyscript"
1617
1718export type Plugin =
1819 | "js"
@@ -22,12 +23,14 @@ export type Plugin =
2223 | "css"
2324 | "babel"
2425 | "wasm"
26+ | "as"
2527 | [ "ts" , typeof typescript ]
2628 | [ "babel" , typeof babel ]
2729 | [ "coffee" , typeof coffeescript ]
2830 | [ "json" , typeof json ]
2931 | [ "css" , typeof cssOnly ]
3032 | [ "wasm" , typeof wasm ]
33+ | [ "as" , typeof asc ]
3134
3235// function to check if the first array has any of the second array
3336// first array can have `[string, object]` as their input
@@ -171,6 +174,19 @@ export function createPlugins(
171174 }
172175 }
173176
177+ // as
178+ const ascIndex = includesAny ( inputPluginsNames , [ "as" , "asc" , "assemblyscript" , "AssemblyScript" ] )
179+ if ( ascIndex !== null ) {
180+ const asc = require ( "rollup-plugin-assemblyscript" )
181+ if ( typeof inputPluginsNames [ ascIndex ] === "string" ) {
182+ // plugin name only
183+ plugins . push ( asc ( ) )
184+ } else {
185+ // plugin with options
186+ plugins . push ( asc ( inputPluginsNames [ ascIndex ] [ 1 ] ) )
187+ }
188+ }
189+
174190 // visualizer
175191 const visualizerIndex = includesAny ( inputPluginsNames , [ "visualizer" , "plot" ] )
176192 if ( visualizerIndex !== null ) {
0 commit comments