Skip to content

Commit b025250

Browse files
author
Cerem Cem ASLAN
committed
added JSON import statement
1 parent 6330580 commit b025250

5 files changed

Lines changed: 10 additions & 1 deletion

File tree

example/external-module/hello.ls

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
require! 'my-lib': {sleep}
22
require! 'fs'
3+
require! './my-data'
34

4-
console.log "hello!"
5+
console.log "hello!", my-data
56
i = 0
67
<~ :lo(op) ~>
78
console.log "looping... #{i++}"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"hi": "there"}

example/external-module/run-ls

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
export NODE_PATH="$NODE_PATH:./my_node_modules"
4+
lsc "$@"

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"dependencies": {},
2020
"devDependencies": {
2121
"@rollup/plugin-commonjs": "^13.0.0",
22+
"@rollup/plugin-json": "^4.1.0",
2223
"@rollup/plugin-node-resolve": "^8.0.1",
2324
"builtin-modules": "^3.1.0",
2425
"rollup-plugin-includepaths": "^0.2.4",

rollup.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import builtins from 'rollup-plugin-node-builtins';
44
import resolve from '@rollup/plugin-node-resolve';
55
import includePaths from 'rollup-plugin-includepaths';
66
const builtinModules = require('builtin-modules');
7+
import json from '@rollup/plugin-json';
78

89

910
let includePathOptions = {
@@ -21,6 +22,7 @@ export default {
2122
plugins: [
2223
livescript(),
2324
includePaths(includePathOptions),
25+
json(),
2426
// commonjs before bultins
2527
commonjs({
2628
extensions: ['.js', '.ls'],

0 commit comments

Comments
 (0)