webpacker 5.4.1 → 6.0.0.rc.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (188) hide show
  1. checksums.yaml +4 -4
  2. data/.eslintrc.js +1 -1
  3. data/.github/workflows/jest.yml +5 -2
  4. data/.github/workflows/js-lint.yml +5 -2
  5. data/.github/workflows/rubocop.yml +1 -1
  6. data/.github/workflows/ruby.yml +19 -4
  7. data/.gitignore +2 -0
  8. data/.node-version +1 -1
  9. data/.rubocop.yml +4 -3
  10. data/CHANGELOG.md +24 -6
  11. data/CONTRIBUTING.md +1 -1
  12. data/Gemfile.lock +82 -82
  13. data/README.md +377 -172
  14. data/config/README.md +3 -0
  15. data/config/webpacker.yml +1 -0
  16. data/docs/deployment.md +9 -11
  17. data/docs/developing_webpacker.md +29 -0
  18. data/docs/troubleshooting.md +57 -25
  19. data/docs/v6_upgrade.md +75 -0
  20. data/gemfiles/Gemfile-rails.6.1.x +12 -0
  21. data/lib/install/bin/yarn +18 -0
  22. data/lib/install/config/webpack/base.js +3 -0
  23. data/lib/install/config/webpack/development.js +2 -2
  24. data/lib/install/config/webpack/production.js +2 -2
  25. data/lib/install/config/webpack/test.js +2 -2
  26. data/lib/install/config/webpacker.yml +20 -50
  27. data/lib/install/package.json +17 -0
  28. data/lib/install/{javascript/packs → packs/entrypoints}/application.js +4 -3
  29. data/lib/install/template.rb +54 -28
  30. data/lib/tasks/webpacker/binstubs.rake +6 -4
  31. data/lib/tasks/webpacker/check_binstubs.rake +4 -4
  32. data/lib/tasks/webpacker/check_node.rake +3 -0
  33. data/lib/tasks/webpacker/check_yarn.rake +3 -0
  34. data/lib/tasks/webpacker/clobber.rake +1 -1
  35. data/lib/tasks/webpacker/compile.rake +4 -2
  36. data/lib/tasks/webpacker/info.rake +12 -10
  37. data/lib/tasks/webpacker/install.rake +6 -4
  38. data/lib/tasks/webpacker/verify_config.rake +14 -0
  39. data/lib/tasks/webpacker/verify_install.rake +1 -10
  40. data/lib/tasks/webpacker/yarn_install.rake +9 -7
  41. data/lib/tasks/webpacker.rake +2 -11
  42. data/lib/tasks/yarn.rake +36 -0
  43. data/lib/webpacker/commands.rb +21 -16
  44. data/lib/webpacker/compiler.rb +16 -9
  45. data/lib/webpacker/configuration.rb +8 -32
  46. data/lib/webpacker/dev_server.rb +6 -0
  47. data/lib/webpacker/dev_server_runner.rb +28 -4
  48. data/lib/webpacker/helper.rb +47 -81
  49. data/lib/webpacker/instance.rb +4 -0
  50. data/lib/webpacker/manifest.rb +2 -3
  51. data/lib/webpacker/railtie.rb +1 -2
  52. data/lib/webpacker/runner.rb +1 -1
  53. data/lib/webpacker/version.rb +1 -1
  54. data/lib/webpacker/webpack_runner.rb +6 -0
  55. data/lib/webpacker.rb +1 -1
  56. data/package/__tests__/config.js +5 -37
  57. data/package/__tests__/development.js +14 -15
  58. data/package/__tests__/env.js +16 -4
  59. data/package/__tests__/index.js +9 -0
  60. data/package/__tests__/production.js +6 -6
  61. data/package/__tests__/staging.js +7 -6
  62. data/package/__tests__/test.js +4 -5
  63. data/package/babel/preset.js +54 -0
  64. data/package/config.js +6 -14
  65. data/package/env.js +13 -4
  66. data/package/environments/__tests__/base.js +20 -52
  67. data/package/environments/base.js +68 -128
  68. data/package/environments/development.js +50 -44
  69. data/package/environments/production.js +66 -64
  70. data/package/environments/test.js +2 -2
  71. data/package/index.js +15 -8
  72. data/package/inliningCss.js +7 -0
  73. data/package/rules/babel.js +10 -8
  74. data/package/rules/coffee.js +6 -0
  75. data/package/rules/erb.js +15 -0
  76. data/package/rules/file.js +21 -19
  77. data/package/rules/index.js +16 -18
  78. data/package/rules/less.js +22 -0
  79. data/package/rules/raw.js +5 -0
  80. data/package/rules/sass.js +9 -10
  81. data/package/rules/stylus.js +26 -0
  82. data/package/utils/get_style_rule.js +28 -36
  83. data/package/utils/helpers.js +28 -35
  84. data/package.json +12 -32
  85. data/test/command_test.rb +76 -0
  86. data/test/compiler_test.rb +0 -12
  87. data/test/configuration_test.rb +4 -35
  88. data/test/dev_server_runner_test.rb +36 -6
  89. data/test/engine_rake_tasks_test.rb +39 -0
  90. data/test/helper_test.rb +79 -77
  91. data/test/manifest_test.rb +16 -0
  92. data/test/mounted_app/Rakefile +4 -0
  93. data/test/mounted_app/test/dummy/Rakefile +3 -0
  94. data/test/mounted_app/test/dummy/bin/rails +3 -0
  95. data/test/mounted_app/test/dummy/bin/rake +3 -0
  96. data/test/mounted_app/test/dummy/config/application.rb +10 -0
  97. data/test/mounted_app/test/dummy/config/environment.rb +3 -0
  98. data/test/mounted_app/test/dummy/config/webpacker.yml +75 -0
  99. data/test/mounted_app/test/dummy/config.ru +5 -0
  100. data/test/mounted_app/test/dummy/package.json +7 -0
  101. data/test/rake_tasks_test.rb +1 -10
  102. data/test/test_app/app/{javascript/packs → packs/entrypoints}/application.js +1 -1
  103. data/test/test_app/app/{javascript/packs → packs/entrypoints}/multi_entry.css +0 -0
  104. data/test/test_app/app/{javascript/packs → packs/entrypoints}/multi_entry.js +0 -0
  105. data/test/test_app/config/webpacker.yml +5 -31
  106. data/test/test_app/config/webpacker_other_location.yml +79 -0
  107. data/test/test_app/config/webpacker_public_root.yml +0 -1
  108. data/test/test_app/public/packs/manifest.json +36 -18
  109. data/test/test_app/some.config.js +0 -0
  110. data/test/webpack_runner_test.rb +9 -3
  111. data/test/webpacker_test.rb +17 -0
  112. data/webpacker.gemspec +1 -1
  113. data/yarn.lock +1050 -3966
  114. metadata +59 -91
  115. data/.travis.yml +0 -43
  116. data/docs/assets.md +0 -119
  117. data/docs/cloud9.md +0 -310
  118. data/docs/css.md +0 -308
  119. data/docs/docker.md +0 -68
  120. data/docs/engines.md +0 -213
  121. data/docs/env.md +0 -63
  122. data/docs/es6.md +0 -72
  123. data/docs/folder-structure.md +0 -66
  124. data/docs/integrations.md +0 -220
  125. data/docs/misc.md +0 -23
  126. data/docs/props.md +0 -223
  127. data/docs/target.md +0 -22
  128. data/docs/testing.md +0 -136
  129. data/docs/typescript.md +0 -190
  130. data/docs/v4-upgrade.md +0 -142
  131. data/docs/webpack-dev-server.md +0 -92
  132. data/docs/webpack.md +0 -364
  133. data/docs/yarn.md +0 -23
  134. data/lib/install/angular.rb +0 -23
  135. data/lib/install/coffee.rb +0 -25
  136. data/lib/install/config/.browserslistrc +0 -1
  137. data/lib/install/config/babel.config.js +0 -76
  138. data/lib/install/config/postcss.config.js +0 -12
  139. data/lib/install/config/webpack/environment.js +0 -3
  140. data/lib/install/elm.rb +0 -39
  141. data/lib/install/erb.rb +0 -25
  142. data/lib/install/examples/angular/hello_angular/app/app.component.ts +0 -9
  143. data/lib/install/examples/angular/hello_angular/app/app.module.ts +0 -16
  144. data/lib/install/examples/angular/hello_angular/index.ts +0 -8
  145. data/lib/install/examples/angular/hello_angular/polyfills.ts +0 -73
  146. data/lib/install/examples/angular/hello_angular.js +0 -7
  147. data/lib/install/examples/coffee/hello_coffee.coffee +0 -4
  148. data/lib/install/examples/elm/Main.elm +0 -55
  149. data/lib/install/examples/elm/hello_elm.js +0 -16
  150. data/lib/install/examples/erb/hello_erb.js.erb +0 -6
  151. data/lib/install/examples/react/babel.config.js +0 -93
  152. data/lib/install/examples/react/hello_react.jsx +0 -26
  153. data/lib/install/examples/react/tsconfig.json +0 -21
  154. data/lib/install/examples/stimulus/application.js +0 -1
  155. data/lib/install/examples/stimulus/controllers/hello_controller.js +0 -18
  156. data/lib/install/examples/stimulus/controllers/index.js +0 -9
  157. data/lib/install/examples/svelte/app.svelte +0 -11
  158. data/lib/install/examples/svelte/hello_svelte.js +0 -20
  159. data/lib/install/examples/typescript/hello_typescript.ts +0 -4
  160. data/lib/install/examples/typescript/tsconfig.json +0 -24
  161. data/lib/install/examples/vue/app.vue +0 -22
  162. data/lib/install/examples/vue/hello_vue.js +0 -72
  163. data/lib/install/loaders/coffee.js +0 -6
  164. data/lib/install/loaders/elm.js +0 -25
  165. data/lib/install/loaders/erb.js +0 -11
  166. data/lib/install/loaders/svelte.js +0 -9
  167. data/lib/install/loaders/vue.js +0 -6
  168. data/lib/install/react.rb +0 -18
  169. data/lib/install/stimulus.rb +0 -12
  170. data/lib/install/svelte.rb +0 -29
  171. data/lib/install/typescript.rb +0 -39
  172. data/lib/install/vue.rb +0 -49
  173. data/lib/tasks/installers.rake +0 -42
  174. data/package/config_types/__tests__/config_list.js +0 -118
  175. data/package/config_types/__tests__/config_object.js +0 -43
  176. data/package/config_types/config_list.js +0 -75
  177. data/package/config_types/config_object.js +0 -55
  178. data/package/config_types/index.js +0 -7
  179. data/package/rules/module.css.js +0 -3
  180. data/package/rules/module.sass.js +0 -8
  181. data/package/rules/node_modules.js +0 -22
  182. data/package/utils/__tests__/deep_assign.js +0 -32
  183. data/package/utils/__tests__/deep_merge.js +0 -10
  184. data/package/utils/__tests__/get_style_rule.js +0 -65
  185. data/package/utils/__tests__/objectify.js +0 -9
  186. data/package/utils/deep_assign.js +0 -22
  187. data/package/utils/deep_merge.js +0 -22
  188. data/package/utils/objectify.js +0 -3
data/docs/yarn.md DELETED
@@ -1,23 +0,0 @@
1
- # Yarn
2
-
3
- Webpacker by default uses `yarn` as a package manager for `node_modules`
4
-
5
-
6
- ## Add a new npm module
7
-
8
- To add any new JS module you can use `yarn`:
9
-
10
- ```bash
11
- yarn add bootstrap material-ui
12
- ```
13
-
14
- ## Add an npm module to `devDependencies`
15
- To add a new JS module that will only be available to local development:
16
-
17
- ```bash
18
- yarn add --dev browser-sync
19
- ```
20
-
21
- Be careful not to add any build or app related JS modules in this fashion. Adding JS modules to `devDependencies` [will block them from being installed in **any** production environment](https://yarnpkg.com/lang/en/docs/cli/install/#toc-yarn-install-production-true-false).
22
-
23
- Docs from JS modules may instruct you to use `--dev` or `devDependencies`, but this is generally under the assumption that you are using a `node.js` workflow.
@@ -1,23 +0,0 @@
1
- require "webpacker/configuration"
2
-
3
- say "Copying angular example entry file to #{Webpacker.config.source_entry_path}"
4
- copy_file "#{__dir__}/examples/angular/hello_angular.js", "#{Webpacker.config.source_entry_path}/hello_angular.js"
5
-
6
- say "Copying hello_angular app to #{Webpacker.config.source_path}"
7
- directory "#{__dir__}/examples/angular/hello_angular", "#{Webpacker.config.source_path}/hello_angular"
8
-
9
- say "Installing all angular dependencies"
10
- run "yarn add core-js zone.js rxjs @angular/core @angular/common @angular/compiler @angular/platform-browser @angular/platform-browser-dynamic"
11
-
12
- if Rails::VERSION::MAJOR == 5 && Rails::VERSION::MINOR > 1
13
- say "You need to enable unsafe-eval rule.", :yellow
14
- say "This can be done in Rails 5.2+ for development environment in the CSP initializer", :yellow
15
- say "config/initializers/content_security_policy.rb with a snippet like this:", :yellow
16
- say "if Rails.env.development?", :yellow
17
- say " policy.script_src :self, :https, :unsafe_eval", :yellow
18
- say "else", :yellow
19
- say " policy.script_src :self, :https", :yellow
20
- say "end", :yellow
21
- end
22
-
23
- say "Webpacker now supports angular 🎉", :green
@@ -1,25 +0,0 @@
1
- require "webpacker/configuration"
2
-
3
- say "Copying coffee loader to config/webpack/loaders"
4
- copy_file "#{__dir__}/loaders/coffee.js", Rails.root.join("config/webpack/loaders/coffee.js").to_s
5
-
6
- say "Adding coffee loader to config/webpack/environment.js"
7
- insert_into_file Rails.root.join("config/webpack/environment.js").to_s,
8
- "const coffee = require('./loaders/coffee')\n",
9
- after: /require\(('|")@rails\/webpacker\1\);?\n/
10
-
11
- insert_into_file Rails.root.join("config/webpack/environment.js").to_s,
12
- "environment.loaders.prepend('coffee', coffee)\n",
13
- before: "module.exports"
14
-
15
- say "Updating webpack paths to include .coffee file extension"
16
- insert_into_file Webpacker.config.config_path, "- .coffee\n".indent(4), after: /\s+extensions:\n/
17
-
18
- say "Copying the example entry file to #{Webpacker.config.source_entry_path}"
19
- copy_file "#{__dir__}/examples/coffee/hello_coffee.coffee",
20
- "#{Webpacker.config.source_entry_path}/hello_coffee.coffee"
21
-
22
- say "Installing all Coffeescript dependencies"
23
- run "yarn add coffeescript@1.12.7 coffee-loader"
24
-
25
- say "Webpacker now supports Coffeescript 🎉", :green
@@ -1 +0,0 @@
1
- defaults
@@ -1,76 +0,0 @@
1
- module.exports = function(api) {
2
- var validEnv = ['development', 'test', 'production']
3
- var currentEnv = api.env()
4
- var isDevelopmentEnv = api.env('development')
5
- var isProductionEnv = api.env('production')
6
- var isTestEnv = api.env('test')
7
-
8
- if (!validEnv.includes(currentEnv)) {
9
- throw new Error(
10
- 'Please specify a valid `NODE_ENV` or ' +
11
- '`BABEL_ENV` environment variables. Valid values are "development", ' +
12
- '"test", and "production". Instead, received: ' +
13
- JSON.stringify(currentEnv) +
14
- '.'
15
- )
16
- }
17
-
18
- return {
19
- presets: [
20
- isTestEnv && [
21
- '@babel/preset-env',
22
- {
23
- targets: {
24
- node: 'current'
25
- }
26
- }
27
- ],
28
- (isProductionEnv || isDevelopmentEnv) && [
29
- '@babel/preset-env',
30
- {
31
- forceAllTransforms: true,
32
- useBuiltIns: 'entry',
33
- corejs: 3,
34
- modules: false,
35
- exclude: ['transform-typeof-symbol']
36
- }
37
- ]
38
- ].filter(Boolean),
39
- plugins: [
40
- 'babel-plugin-macros',
41
- '@babel/plugin-syntax-dynamic-import',
42
- isTestEnv && 'babel-plugin-dynamic-import-node',
43
- '@babel/plugin-transform-destructuring',
44
- [
45
- '@babel/plugin-proposal-class-properties',
46
- {
47
- loose: true
48
- }
49
- ],
50
- [
51
- '@babel/plugin-proposal-object-rest-spread',
52
- {
53
- useBuiltIns: true
54
- }
55
- ],
56
- [
57
- '@babel/plugin-proposal-private-methods',
58
- {
59
- loose: true
60
- }
61
- ],
62
- [
63
- '@babel/plugin-transform-runtime',
64
- {
65
- helpers: false
66
- }
67
- ],
68
- [
69
- '@babel/plugin-transform-regenerator',
70
- {
71
- async: false
72
- }
73
- ]
74
- ].filter(Boolean)
75
- }
76
- }
@@ -1,12 +0,0 @@
1
- module.exports = {
2
- plugins: [
3
- require('postcss-import'),
4
- require('postcss-flexbugs-fixes'),
5
- require('postcss-preset-env')({
6
- autoprefixer: {
7
- flexbox: 'no-2009'
8
- },
9
- stage: 3
10
- })
11
- ]
12
- }
@@ -1,3 +0,0 @@
1
- const { environment } = require('@rails/webpacker')
2
-
3
- module.exports = environment
data/lib/install/elm.rb DELETED
@@ -1,39 +0,0 @@
1
- require "webpacker/configuration"
2
-
3
- say "Copying elm loader to config/webpack/loaders"
4
- copy_file "#{__dir__}/loaders/elm.js", Rails.root.join("config/webpack/loaders/elm.js").to_s
5
-
6
- say "Adding elm loader to config/webpack/environment.js"
7
- insert_into_file Rails.root.join("config/webpack/environment.js").to_s,
8
- "const elm = require('./loaders/elm')\n",
9
- after: /require\(('|")@rails\/webpacker\1\);?\n/
10
-
11
- insert_into_file Rails.root.join("config/webpack/environment.js").to_s,
12
- "environment.loaders.prepend('elm', elm)\n",
13
- before: "module.exports"
14
-
15
- say "Copying Elm example entry file to #{Webpacker.config.source_entry_path}"
16
- copy_file "#{__dir__}/examples/elm/hello_elm.js",
17
- "#{Webpacker.config.source_entry_path}/hello_elm.js"
18
-
19
- say "Copying Elm app file to #{Webpacker.config.source_path}"
20
- copy_file "#{__dir__}/examples/elm/Main.elm",
21
- "#{Webpacker.config.source_path}/Main.elm"
22
-
23
- say "Installing all Elm dependencies"
24
- run "yarn add elm elm-webpack-loader"
25
- run "yarn add --dev elm-hot-webpack-loader"
26
- run "yarn run elm init"
27
- run "yarn run elm make #{Webpacker.config.source_path}/Main.elm"
28
-
29
- say "Updating webpack paths to include .elm file extension"
30
- insert_into_file Webpacker.config.config_path, "- .elm\n".indent(4), after: /\s+extensions:\n/
31
-
32
- say "Updating Elm source location"
33
- gsub_file "elm.json", /\"src\"\n/,
34
- %("#{Webpacker.config.source_path.relative_path_from(Rails.root)}"\n)
35
-
36
- say "Updating .gitignore to include elm-stuff folder"
37
- insert_into_file ".gitignore", "/elm-stuff\n", before: "/node_modules\n"
38
-
39
- say "Webpacker now supports Elm 🎉", :green
data/lib/install/erb.rb DELETED
@@ -1,25 +0,0 @@
1
- require "webpacker/configuration"
2
-
3
- say "Copying erb loader to config/webpack/loaders"
4
- copy_file "#{__dir__}/loaders/erb.js", Rails.root.join("config/webpack/loaders/erb.js").to_s
5
-
6
- say "Adding erb loader to config/webpack/environment.js"
7
- insert_into_file Rails.root.join("config/webpack/environment.js").to_s,
8
- "const erb = require('./loaders/erb')\n",
9
- after: /require\(('|")@rails\/webpacker\1\);?\n/
10
-
11
- insert_into_file Rails.root.join("config/webpack/environment.js").to_s,
12
- "environment.loaders.prepend('erb', erb)\n",
13
- before: "module.exports"
14
-
15
- say "Updating webpack paths to include .erb file extension"
16
- insert_into_file Webpacker.config.config_path, "- .erb\n".indent(4), after: /\s+extensions:\n/
17
-
18
- say "Copying the example entry file to #{Webpacker.config.source_entry_path}"
19
- copy_file "#{__dir__}/examples/erb/hello_erb.js.erb",
20
- "#{Webpacker.config.source_entry_path}/hello_erb.js.erb"
21
-
22
- say "Installing all Erb dependencies"
23
- run "yarn add rails-erb-loader"
24
-
25
- say "Webpacker now supports Erb in JS 🎉", :green
@@ -1,9 +0,0 @@
1
- import { Component } from '@angular/core';
2
-
3
- @Component({
4
- selector: 'hello-angular',
5
- template: `<h1>Hello {{name}}</h1>`
6
- })
7
- export class AppComponent {
8
- name = 'Angular!';
9
- }
@@ -1,16 +0,0 @@
1
- import { BrowserModule } from '@angular/platform-browser';
2
- import { NgModule } from '@angular/core';
3
-
4
- import { AppComponent } from './app.component';
5
-
6
- @NgModule({
7
- declarations: [
8
- AppComponent
9
- ],
10
- imports: [
11
- BrowserModule
12
- ],
13
- providers: [],
14
- bootstrap: [AppComponent]
15
- })
16
- export class AppModule { }
@@ -1,8 +0,0 @@
1
- import './polyfills.ts';
2
-
3
- import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
4
- import { AppModule } from './app/app.module';
5
-
6
- document.addEventListener('DOMContentLoaded', () => {
7
- platformBrowserDynamic().bootstrapModule(AppModule);
8
- });
@@ -1,73 +0,0 @@
1
- /**
2
- * This file includes polyfills needed by Angular and is loaded before the app.
3
- * You can add your own extra polyfills to this file.
4
- *
5
- * This file is divided into 2 sections:
6
- * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
7
- * 2. Application imports. Files imported after ZoneJS that should be loaded before your main
8
- * file.
9
- *
10
- * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
11
- * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
12
- * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
13
- *
14
- * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
15
- */
16
-
17
- /***************************************************************************************************
18
- * BROWSER POLYFILLS
19
- */
20
-
21
- /** IE9, IE10 and IE11 requires all of the following polyfills. **/
22
- // import 'core-js/es6/symbol';
23
- // import 'core-js/es6/object';
24
- // import 'core-js/es6/function';
25
- // import 'core-js/es6/parse-int';
26
- // import 'core-js/es6/parse-float';
27
- // import 'core-js/es6/number';
28
- // import 'core-js/es6/math';
29
- // import 'core-js/es6/string';
30
- // import 'core-js/es6/date';
31
- // import 'core-js/es6/array';
32
- // import 'core-js/es6/regexp';
33
- // import 'core-js/es6/map';
34
- // import 'core-js/es6/weak-map';
35
- // import 'core-js/es6/set';
36
-
37
- /** IE10 and IE11 requires the following for NgClass support on SVG elements */
38
- // import 'classlist.js'; // Run `npm install --save classlist.js`.
39
-
40
- /** Evergreen browsers require these. **/
41
- import 'core-js/es/reflect';
42
- import 'core-js/proposals/reflect-metadata';
43
-
44
-
45
- /**
46
- * Required to support Web Animations `@angular/animation`.
47
- * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation
48
- **/
49
- // import 'web-animations-js'; // Run `npm install --save web-animations-js`.
50
-
51
-
52
-
53
- /***************************************************************************************************
54
- * Zone JS is required by Angular itself.
55
- */
56
- import 'zone.js/dist/zone';
57
- // import 'zone.js/dist/long-stack-trace-zone' // async stack traces with zone.js
58
-
59
-
60
-
61
- /***************************************************************************************************
62
- * APPLICATION IMPORTS
63
- */
64
-
65
- /**
66
- * Date, currency, decimal and percent pipes.
67
- * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10
68
- */
69
- // import 'intl'; // Run `npm install --save intl`.
70
- /**
71
- * Need to import at least one locale-data with intl.
72
- */
73
- // import 'intl/locale-data/jsonp/en';
@@ -1,7 +0,0 @@
1
- // Run this Angular example by adding the following HTML markup to your view:
2
- //
3
- // <hello-angular>Loading...</hello-angular>
4
- //
5
- // <%= javascript_pack_tag 'hello_angular' %>
6
-
7
- require('../hello_angular')
@@ -1,4 +0,0 @@
1
- # Run this example by adding <%= javascript_pack_tag 'hello_coffee' %> to the head of your layout file,
2
- # like app/views/layouts/application.html.erb.
3
-
4
- console.log 'Hello world from coffeescript'
@@ -1,55 +0,0 @@
1
- module Main exposing (..)
2
-
3
- import Browser
4
- import Html exposing (Html, h1, text)
5
- import Html.Attributes exposing (style)
6
-
7
- -- MODEL
8
-
9
- type alias Model =
10
- {
11
- }
12
-
13
- -- INIT
14
-
15
- init : (Model, Cmd Message)
16
- init =
17
- (Model, Cmd.none)
18
-
19
- -- VIEW
20
-
21
- view : Model -> Html Message
22
- view model =
23
- -- The inline style is being used for example purposes in order to keep this example simple and
24
- -- avoid loading additional resources. Use a proper stylesheet when building your own app.
25
- h1 [style "display" "flex", style "justify-content" "center"]
26
- [text "Hello Elm!"]
27
-
28
- -- MESSAGE
29
-
30
- type Message
31
- = None
32
-
33
- -- UPDATE
34
-
35
- update : Message -> Model -> (Model, Cmd Message)
36
- update message model =
37
- (model, Cmd.none)
38
-
39
- -- SUBSCRIPTIONS
40
-
41
- subscriptions : Model -> Sub Message
42
- subscriptions model =
43
- Sub.none
44
-
45
- -- MAIN
46
-
47
- main : Program (Maybe {}) Model Message
48
- main =
49
- Browser.element
50
- {
51
- init = always init,
52
- view = view,
53
- update = update,
54
- subscriptions = subscriptions
55
- }
@@ -1,16 +0,0 @@
1
- // Run this example by adding <%= javascript_pack_tag "hello_elm" %> to the
2
- // head of your layout file, like app/views/layouts/application.html.erb.
3
- // It will render "Hello Elm!" within the page.
4
-
5
- import {
6
- Elm
7
- } from '../Main'
8
-
9
- document.addEventListener('DOMContentLoaded', () => {
10
- const target = document.createElement('div')
11
-
12
- document.body.appendChild(target)
13
- Elm.Main.init({
14
- node: target
15
- })
16
- })