Skip to content

Commit 8d58e95

Browse files
committed
rollup config + dist folder
Update .gitignore
1 parent 370b8a0 commit 8d58e95

File tree

3 files changed

+53
-1
lines changed

3 files changed

+53
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
*.log
22
node_modules
3+
dist

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"url": "https://github.com/JunoLab/language-weave/issues"
1515
},
1616
"homepage": "https://github.com/JunoLab/language-weave",
17-
"main": "lib/main.js",
17+
"main": "dist/main.js",
1818
"extensions": {
1919
".json": [
2020
"package.json"

rollup.config.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import resolve from '@rollup/plugin-node-resolve';
2+
import commonjs from '@rollup/plugin-commonjs';
3+
import coffeescript from 'rollup-plugin-coffee-script';
4+
import {terser} from 'rollup-plugin-terser';
5+
6+
let plugins = [
7+
// if any (in deps as well): Convert CoffeeScript to JavaScript
8+
coffeescript(),
9+
10+
// so Rollup can find externals
11+
resolve({extensions: ['.js', '.coffee'], preferBuiltins: true}),
12+
13+
// so Rollup can convert externals to an ES module
14+
commonjs(),
15+
];
16+
17+
// minify only in production mode
18+
if (process.env.NODE_ENV === 'production') {
19+
plugins.push(
20+
// minify
21+
terser({
22+
ecma: 2018,
23+
warnings: true,
24+
compress: {
25+
drop_console: true,
26+
},
27+
})
28+
);
29+
}
30+
31+
export default [
32+
{
33+
input: 'lib/main.js',
34+
output: [
35+
{
36+
dir: "dist",
37+
format: 'cjs',
38+
sourcemap: true,
39+
},
40+
],
41+
// loaded externally
42+
external: [
43+
"atom-space-pen-views", // loaded because of errors
44+
"atom",
45+
// node stuff
46+
"fs",
47+
"path",
48+
],
49+
plugins: plugins,
50+
},
51+
];

0 commit comments

Comments
 (0)