File tree Expand file tree Collapse file tree 3 files changed +21
-9
lines changed Expand file tree Collapse file tree 3 files changed +21
-9
lines changed Original file line number Diff line number Diff line change 4
4
say "Add build script"
5
5
build_script = "esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=assets"
6
6
7
- if ( `npx -v` . to_f < 7.1 rescue "Missing" )
8
- say %(Add "scripts": { "build": "#{ build_script } " } to your package.json) , :green
9
- else
7
+ case `npx -v` . to_f
8
+ when 7.1 ...8.0
10
9
run %(npm set-script build "#{ build_script } ")
11
10
run %(yarn build)
11
+ when 8.0 ..
12
+ run %(npm pkg set scripts.build="#{ build_script } ")
13
+ run %(yarn build)
14
+ else
15
+ say %(Add "scripts": { "build": "#{ build_script } " } to your package.json) , :green
12
16
end
Original file line number Diff line number Diff line change 5
5
say "Add build script"
6
6
build_script = "rollup -c --bundleConfigAsCjs rollup.config.js"
7
7
8
- if ( `npx -v` . to_f < 7.1 rescue "Missing" )
9
- say %(Add "scripts": { "build": "#{ build_script } " } to your package.json) , :green
10
- else
8
+ case `npx -v` . to_f
9
+ when 7.1 ...8.0
11
10
run %(npm set-script build "#{ build_script } ")
12
11
run %(yarn build)
12
+ when 8.0 ..
13
+ run %(npm pkg set scripts.build="#{ build_script } ")
14
+ run %(yarn build)
15
+ else
16
+ say %(Add "scripts": { "build": "#{ build_script } " } to your package.json) , :green
13
17
end
Original file line number Diff line number Diff line change 5
5
say "Add build script"
6
6
build_script = "webpack --config webpack.config.js"
7
7
8
- if ( `npx -v` . to_f < 7.1 rescue "Missing" )
9
- say %(Add "scripts": { "build": "#{ build_script } " } to your package.json) , :green
10
- else
8
+ case `npx -v` . to_f
9
+ when 7.1 ...8.0
11
10
run %(npm set-script build "#{ build_script } ")
12
11
run %(yarn build)
12
+ when 8.0 ..
13
+ run %(npm pkg set scripts.build="#{ build_script } ")
14
+ run %(yarn build)
15
+ else
16
+ say %(Add "scripts": { "build": "#{ build_script } " } to your package.json) , :green
13
17
end
You can’t perform that action at this time.
0 commit comments