瀏覽代碼

Add empty map to glsl plugin (#9745)

That is how it should look like according to rollup plugin conventions: https://github.com/rollup/rollup/wiki/Plugins
Jarosław Konik 8 年之前
父節點
當前提交
f039ee722c
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      rollup.config.js

+ 5 - 1
rollup.config.js

@@ -12,12 +12,16 @@ function glsl () {
 		transform ( code, id ) {
 		transform ( code, id ) {
 			if ( !/\.glsl$/.test( id ) ) return;
 			if ( !/\.glsl$/.test( id ) ) return;
 
 
-			return 'export default ' + JSON.stringify(
+			var transformedCode = 'export default ' + JSON.stringify(
 				code
 				code
 					.replace( /[ \t]*\/\/.*\n/g, '' )
 					.replace( /[ \t]*\/\/.*\n/g, '' )
 					.replace( /[ \t]*\/\*[\s\S]*?\*\//g, '' )
 					.replace( /[ \t]*\/\*[\s\S]*?\*\//g, '' )
 					.replace( /\n{2,}/g, '\n' )
 					.replace( /\n{2,}/g, '\n' )
 			) + ';';
 			) + ';';
+			return {
+				code: transformedCode,
+				map: { mappings: '' }
+			}
 		}
 		}
 	};
 	};
 }
 }