UNPKG

1.4 kBJavaScriptView Raw
1import json from 'rollup-plugin-json';
2import commonjs from 'rollup-plugin-commonjs';
3import nodeResolve from 'rollup-plugin-node-resolve';
4import replace from 'rollup-plugin-replace';
5import builtins from 'rollup-plugin-node-builtins';
6import globals from 'rollup-plugin-node-globals';
7
8export default ({
9 entry: 'src/index.js',
10 external: ['three'],
11 plugins: [
12 builtins(),
13 nodeResolve({ jsnext: true, module:true }),
14 commonjs({
15 ignoreGlobal: true,
16 exclude: [
17 '**/rollup-plugin-node-globals/**',
18 '**/rollup-plugin-node-builtins/**',
19 '**/three/**'
20 ]
21 }),
22 globals(),
23 json(),
24 replace({
25 ENVIRONMENT: 'BROWSER',
26 delimiters: [ '${', '}' ]
27 }),
28 // Workaround below is based on this issue.
29 // https://github.com/rollup/rollup/issues/1007
30 // Will not be needed after gl-matrix uses ES6 modules
31 // https://github.com/toji/gl-matrix/pull/209
32 replace({
33 include: '**/gl-matrix/src/gl-matrix/common.js',
34 values: { '\'SIMD\' in this': '\'SIMD\' in global' }
35 }),
36 replace({
37 include: '**/rollup-plugin-node-builtins/**',
38 values: { 'global.location.host ': '(!global.location?global.location:global.location.host) ' }
39 })
40 ]
41});