webpacker 6.0.0.beta.2 → 6.0.0.beta.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/jest.yml +1 -1
  3. data/.github/workflows/js-lint.yml +1 -1
  4. data/.github/workflows/ruby.yml +9 -6
  5. data/.rubocop.yml +105 -0
  6. data/CHANGELOG.md +6 -4
  7. data/CONTRIBUTING.md +1 -1
  8. data/Gemfile.lock +93 -90
  9. data/README.md +133 -58
  10. data/config/README.md +3 -0
  11. data/config/webpacker.yml +1 -0
  12. data/docs/deployment.md +128 -0
  13. data/docs/troubleshooting.md +160 -0
  14. data/docs/v6_upgrade.md +86 -0
  15. data/lib/install/config/webpacker.yml +5 -3
  16. data/lib/install/{javascript/packs → packs/entrypoints}/application.js +1 -1
  17. data/lib/install/template.rb +16 -9
  18. data/lib/tasks/webpacker/binstubs.rake +2 -2
  19. data/lib/tasks/webpacker/check_node.rake +1 -0
  20. data/lib/tasks/webpacker/check_yarn.rake +1 -0
  21. data/lib/tasks/webpacker/install.rake +2 -2
  22. data/lib/webpacker/commands.rb +2 -1
  23. data/lib/webpacker/compiler.rb +2 -2
  24. data/lib/webpacker/configuration.rb +4 -4
  25. data/lib/webpacker/dev_server_runner.rb +2 -0
  26. data/lib/webpacker/helper.rb +13 -43
  27. data/lib/webpacker/manifest.rb +1 -1
  28. data/lib/webpacker/version.rb +1 -1
  29. data/lib/webpacker/webpack_runner.rb +1 -0
  30. data/package.json +1 -1
  31. data/package/__tests__/development.js +2 -1
  32. data/package/__tests__/index.js +9 -0
  33. data/package/environments/__tests__/base.js +4 -4
  34. data/package/environments/base.js +3 -8
  35. data/package/environments/development.js +1 -0
  36. data/package/environments/production.js +1 -1
  37. data/package/index.js +3 -3
  38. data/package/rules/babel.js +1 -1
  39. data/package/rules/stylus.js +1 -1
  40. data/package/utils/helpers.js +4 -2
  41. data/test/configuration_test.rb +2 -2
  42. data/test/dev_server_runner_test.rb +10 -2
  43. data/test/helper_test.rb +33 -39
  44. data/test/manifest_test.rb +8 -0
  45. data/test/mounted_app/test/dummy/config/webpacker.yml +3 -3
  46. data/test/test_app/app/{javascript/packs → packs/entrypoints}/application.js +1 -1
  47. data/test/test_app/app/{javascript/packs → packs/entrypoints}/multi_entry.css +0 -0
  48. data/test/test_app/app/{javascript/packs → packs/entrypoints}/multi_entry.js +0 -0
  49. data/test/test_app/config/webpacker.yml +3 -3
  50. data/test/test_app/public/packs/manifest.json +7 -0
  51. metadata +18 -14
  52. data/6_0_upgrade.md +0 -43
  53. data/lib/install/javascript/packs/application.css +0 -9
@@ -72,27 +72,15 @@ module Webpacker::Helper
72
72
  favicon_link_tag(resolve_path_to_image(name), options)
73
73
  end
74
74
 
75
- # Creates a script tag that references the named pack file, as compiled by webpack per the entries list
76
- # in package/environments/base.js. By default, this list is auto-generated to match everything in
77
- # app/javascript/packs/*.js. In production mode, the digested reference is automatically looked up.
78
- #
79
- # Example:
80
- #
81
- # <%= javascript_pack_tag 'calendar', 'data-turbolinks-track': 'reload' %> # =>
82
- # <script src="/packs/calendar-1016838bab065ae1e314.js" data-turbolinks-track="reload"></script>
83
- def javascript_pack_tag(*names, **options)
84
- javascript_include_tag(*sources_from_manifest_entries(names, type: :javascript), **options)
85
- end
86
-
87
75
  # Creates script tags that reference the js chunks from entrypoints when using split chunks API,
88
76
  # as compiled by webpack per the entries list in package/environments/base.js.
89
77
  # By default, this list is auto-generated to match everything in
90
- # app/javascript/packs/*.js and all the dependent chunks. In production mode, the digested reference is automatically looked up.
78
+ # app/packs/entrypoints/*.js and all the dependent chunks. In production mode, the digested reference is automatically looked up.
91
79
  # See: https://webpack.js.org/plugins/split-chunks-plugin/
92
80
  #
93
81
  # Example:
94
82
  #
95
- # <%= javascript_packs_with_chunks_tag 'calendar', 'map', 'data-turbolinks-track': 'reload' %> # =>
83
+ # <%= javascript_pack_tag 'calendar', 'map', 'data-turbolinks-track': 'reload' %> # =>
96
84
  # <script src="/packs/vendor-16838bab065ae1e314.chunk.js" data-turbolinks-track="reload"></script>
97
85
  # <script src="/packs/calendar~runtime-16838bab065ae1e314.chunk.js" data-turbolinks-track="reload"></script>
98
86
  # <script src="/packs/calendar-1016838bab065ae1e314.chunk.js" data-turbolinks-track="reload"></script>
@@ -101,13 +89,13 @@ module Webpacker::Helper
101
89
  #
102
90
  # DO:
103
91
  #
104
- # <%= javascript_packs_with_chunks_tag 'calendar', 'map' %>
92
+ # <%= javascript_pack_tag 'calendar', 'map' %>
105
93
  #
106
94
  # DON'T:
107
95
  #
108
- # <%= javascript_packs_with_chunks_tag 'calendar' %>
109
- # <%= javascript_packs_with_chunks_tag 'map' %>
110
- def javascript_packs_with_chunks_tag(*names, **options)
96
+ # <%= javascript_pack_tag 'calendar' %>
97
+ # <%= javascript_pack_tag 'map' %>
98
+ def javascript_pack_tag(*names, **options)
111
99
  javascript_include_tag(*sources_from_manifest_entrypoints(names, type: :javascript), **options)
112
100
  end
113
101
 
@@ -127,53 +115,35 @@ module Webpacker::Helper
127
115
  end
128
116
  end
129
117
 
130
- # Creates a link tag that references the named pack file, as compiled by webpack per the entries list
131
- # in package/environments/base.js. By default, this list is auto-generated to match everything in
132
- # app/javascript/packs/*.js. In production mode, the digested reference is automatically looked up.
133
- #
134
- # Note: If the development server is running and hot module replacement is active, this will return nothing.
135
- # In that setup you need to configure your styles to be inlined in your JavaScript for hot reloading.
136
- #
137
- # Examples:
138
- #
139
- # <%= stylesheet_pack_tag 'calendar', 'data-turbolinks-track': 'reload' %> # =>
140
- # <link rel="stylesheet" media="screen" href="/packs/calendar-1016838bab065ae1e122.css" data-turbolinks-track="reload" />
141
- def stylesheet_pack_tag(*names, **options)
142
- stylesheet_link_tag(*sources_from_manifest_entries(names, type: :stylesheet), **options)
143
- end
144
-
145
118
  # Creates link tags that reference the css chunks from entrypoints when using split chunks API,
146
119
  # as compiled by webpack per the entries list in package/environments/base.js.
147
120
  # By default, this list is auto-generated to match everything in
148
- # app/javascript/packs/*.js and all the dependent chunks. In production mode, the digested reference is automatically looked up.
121
+ # app/packs/entrypoints/*.js and all the dependent chunks. In production mode, the digested reference is automatically looked up.
149
122
  # See: https://webpack.js.org/plugins/split-chunks-plugin/
150
123
  #
151
124
  # Examples:
152
125
  #
153
- # <%= stylesheet_packs_with_chunks_tag 'calendar', 'map' %> # =>
126
+ # <%= stylesheet_pack_tag 'calendar', 'map' %> # =>
154
127
  # <link rel="stylesheet" media="screen" href="/packs/3-8c7ce31a.chunk.css" />
155
128
  # <link rel="stylesheet" media="screen" href="/packs/calendar-8c7ce31a.chunk.css" />
156
129
  # <link rel="stylesheet" media="screen" href="/packs/map-8c7ce31a.chunk.css" />
157
130
  #
158
131
  # DO:
159
132
  #
160
- # <%= stylesheet_packs_with_chunks_tag 'calendar', 'map' %>
133
+ # <%= stylesheet_pack_tag 'calendar', 'map' %>
161
134
  #
162
135
  # DON'T:
163
136
  #
164
- # <%= stylesheet_packs_with_chunks_tag 'calendar' %>
165
- # <%= stylesheet_packs_with_chunks_tag 'map' %>
166
- def stylesheet_packs_with_chunks_tag(*names, **options)
137
+ # <%= stylesheet_pack_tag 'calendar' %>
138
+ # <%= stylesheet_pack_tag 'map' %>
139
+ def stylesheet_pack_tag(*names, **options)
167
140
  stylesheet_link_tag(*sources_from_manifest_entrypoints(names, type: :stylesheet), **options)
168
141
  end
169
142
 
170
143
  private
171
- def sources_from_manifest_entries(names, type:)
172
- names.map { |name| current_webpacker_instance.manifest.lookup!(name, type: type) }.flatten
173
- end
174
144
 
175
145
  def sources_from_manifest_entrypoints(names, type:)
176
- names.map { |name| current_webpacker_instance.manifest.lookup_pack_with_chunks!(name, type: type) }.flatten.uniq
146
+ names.map { |name| current_webpacker_instance.manifest.lookup_pack_with_chunks!(name.to_s, type: type) }.flatten.uniq
177
147
  end
178
148
 
179
149
  def resolve_path_to_image(name, **options)
@@ -92,7 +92,7 @@ class Webpacker::Manifest
92
92
  # When the user provides a name with a file extension, we want to try to strip it off.
93
93
  def manifest_name(name, pack_type)
94
94
  return name if File.extname(name.to_s).empty?
95
- File.basename(name, pack_type)
95
+ File.basename(name, ".#{pack_type}")
96
96
  end
97
97
 
98
98
  def manifest_type(pack_type)
@@ -1,4 +1,4 @@
1
1
  module Webpacker
2
2
  # Change the version in package.json too, please!
3
- VERSION = "6.0.0.beta.2".freeze
3
+ VERSION = "6.0.0.beta.7".freeze
4
4
  end
@@ -15,6 +15,7 @@ module Webpacker
15
15
 
16
16
  if @argv.include?("--debug-webpacker")
17
17
  cmd = [ "node", "--inspect-brk"] + cmd
18
+ @argv.delete "--debug-webpacker"
18
19
  end
19
20
 
20
21
  if @argv.include?("--trace-deprecation")
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rails/webpacker",
3
- "version": "6.0.0-beta.2",
3
+ "version": "6.0.0-beta.7",
4
4
  "description": "Use webpack to manage app-like JavaScript modules in Rails",
5
5
  "main": "package/index.js",
6
6
  "files": [
@@ -22,7 +22,8 @@ describe('Development environment', () => {
22
22
  expect(webpackConfig).toMatchObject({
23
23
  devServer: {
24
24
  host: 'localhost',
25
- port: 3035
25
+ port: 3035,
26
+ injectClient: true
26
27
  }
27
28
  })
28
29
  })
@@ -0,0 +1,9 @@
1
+ const index = require('../index')
2
+
3
+ describe('index', () => {
4
+ test('exports webpack-merge v5 functions', () => {
5
+ expect(index.merge).toBeInstanceOf(Function)
6
+ expect(index.mergeWithRules).toBeInstanceOf(Function)
7
+ expect(index.mergeWithCustomize).toBeInstanceOf(Function)
8
+ })
9
+ })
@@ -17,14 +17,14 @@ describe('Base config', () => {
17
17
  describe('config', () => {
18
18
  test('should return entry', () => {
19
19
  expect(baseConfig.entry.application).toEqual(
20
- resolve('app', 'javascript', 'packs', 'application.js')
20
+ resolve('app', 'packs', 'entrypoints', 'application.js')
21
21
  )
22
22
  })
23
23
 
24
24
  test('should return multi file entry points', () => {
25
25
  expect(baseConfig.entry.multi_entry.sort()).toEqual([
26
- resolve('app', 'javascript', 'packs', 'multi_entry.css'),
27
- resolve('app', 'javascript', 'packs', 'multi_entry.js')
26
+ resolve('app', 'packs', 'entrypoints', 'multi_entry.css'),
27
+ resolve('app', 'packs', 'entrypoints', 'multi_entry.js')
28
28
  ])
29
29
  })
30
30
 
@@ -53,7 +53,7 @@ describe('Base config', () => {
53
53
 
54
54
  test('should return default resolve.modules with additions', () => {
55
55
  expect(baseConfig.resolve.modules).toEqual([
56
- resolve('app', 'javascript'),
56
+ resolve('app', 'packs'),
57
57
  resolve('app/assets'),
58
58
  resolve('/etc/yarn'),
59
59
  resolve('some.config.js'),
@@ -10,7 +10,6 @@ const WebpackAssetsManifest = require('webpack-assets-manifest')
10
10
  const webpack = require('webpack')
11
11
  const rules = require('../rules')
12
12
  const config = require('../config')
13
- const { isDevelopment } = require('../env')
14
13
  const { moduleExists } = require('../utils/helpers')
15
14
 
16
15
  const getEntryObject = () => {
@@ -67,12 +66,8 @@ const getPlugins = () => {
67
66
  const MiniCssExtractPlugin = require('mini-css-extract-plugin')
68
67
  plugins.push(
69
68
  new MiniCssExtractPlugin({
70
- filename: isDevelopment
71
- ? 'css/[name].css'
72
- : 'css/[name]-[contenthash:8].css',
73
- chunkFilename: isDevelopment
74
- ? 'css/[id].css'
75
- : 'css/[id]-[contenthash:8].css'
69
+ filename: 'css/[name]-[contenthash:8].css',
70
+ chunkFilename: 'css/[id]-[contenthash:8].css'
76
71
  })
77
72
  )
78
73
  }
@@ -91,7 +86,7 @@ module.exports = {
91
86
  },
92
87
  entry: getEntryObject(),
93
88
  resolve: {
94
- extensions: ['.js', '.mjs', '.ts', '.coffee'],
89
+ extensions: ['.js', '.jsx', '.mjs', '.ts', '.tsx', '.coffee'],
95
90
  modules: getModulePaths(),
96
91
  plugins: [PnpWebpackPlugin]
97
92
  },
@@ -34,6 +34,7 @@ if (
34
34
  hot: devServer.hmr,
35
35
  contentBase,
36
36
  inline: devServer.inline,
37
+ injectClient: devServer.inject_client,
37
38
  useLocalIp: devServer.use_local_ip,
38
39
  public: devServer.public,
39
40
  publicPath,
@@ -37,7 +37,7 @@ const tryCssMinimizer = () => {
37
37
  moduleExists('css-minimizer-webpack-plugin')
38
38
  ) {
39
39
  const CssMinimizerPlugin = require('css-minimizer-webpack-plugin')
40
- return new CssMinimizerPlugin({ sourceMap: true })
40
+ return new CssMinimizerPlugin()
41
41
  }
42
42
 
43
43
  return null
data/package/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /* eslint global-require: 0 */
2
2
  /* eslint import/no-dynamic-require: 0 */
3
3
 
4
- const { merge } = require('webpack-merge')
4
+ const webpackMerge = require('webpack-merge')
5
5
  const { resolve } = require('path')
6
6
  const { existsSync } = require('fs')
7
7
  const baseConfig = require('./environments/base')
@@ -23,7 +23,7 @@ module.exports = {
23
23
  webpackConfig: webpackConfig(),
24
24
  baseConfig,
25
25
  rules,
26
- merge,
27
26
  moduleExists,
28
- canProcess
27
+ canProcess,
28
+ ...webpackMerge
29
29
  }
@@ -8,7 +8,7 @@ const {
8
8
  const { isProduction } = require('../env')
9
9
 
10
10
  module.exports = {
11
- test: /\.(js|jsx|mjs|ts|tsx)?(\.erb)?$/,
11
+ test: /\.(js|jsx|mjs|ts|tsx|coffee)?(\.erb)?$/,
12
12
  include: [sourcePath, ...additionalPaths].map((p) => {
13
13
  try {
14
14
  return realpathSync(p)
@@ -8,7 +8,7 @@ const {
8
8
  } = require('../config')
9
9
 
10
10
  module.exports = canProcess('stylus-loader', (resolvedPath) =>
11
- getStyleRule(/\.(styl)(\.erb)?$/i, [
11
+ getStyleRule(/\.(styl(us)?)(\.erb)?$/i, [
12
12
  {
13
13
  loader: resolvedPath,
14
14
  options: {
@@ -16,7 +16,7 @@ const resetEnv = () => {
16
16
 
17
17
  const ensureTrailingSlash = (path) => (path.endsWith('/') ? path : `${path}/`)
18
18
 
19
- const moduleExists = (packageName) => {
19
+ const resolvedPath = (packageName) => {
20
20
  try {
21
21
  return require.resolve(packageName)
22
22
  } catch (e) {
@@ -27,8 +27,10 @@ const moduleExists = (packageName) => {
27
27
  }
28
28
  }
29
29
 
30
+ const moduleExists = (packageName) => (!!resolvedPath(packageName))
31
+
30
32
  const canProcess = (rule, fn) => {
31
- const modulePath = moduleExists(rule)
33
+ const modulePath = resolvedPath(rule)
32
34
 
33
35
  if (modulePath) {
34
36
  return fn(modulePath)
@@ -10,12 +10,12 @@ class ConfigurationTest < Webpacker::Test
10
10
  end
11
11
 
12
12
  def test_source_path
13
- source_path = File.expand_path File.join(File.dirname(__FILE__), "test_app/app/javascript").to_s
13
+ source_path = File.expand_path File.join(File.dirname(__FILE__), "test_app/app/packs").to_s
14
14
  assert_equal source_path, @config.source_path.to_s
15
15
  end
16
16
 
17
17
  def test_source_entry_path
18
- source_entry_path = File.expand_path File.join(File.dirname(__FILE__), "test_app/app/javascript", "packs").to_s
18
+ source_entry_path = File.expand_path File.join(File.dirname(__FILE__), "test_app/app/packs", "entrypoints").to_s
19
19
  assert_equal @config.source_entry_path.to_s, source_entry_path
20
20
  end
21
21
 
@@ -43,19 +43,27 @@ class DevServerRunnerTest < Webpacker::Test
43
43
  end
44
44
  end
45
45
 
46
+ def test_environment_variables
47
+ cmd = ["#{test_app_path}/node_modules/.bin/webpack", "serve", "--config", "#{test_app_path}/config/webpack/development.js"]
48
+ env = Webpacker::Compiler.env.dup
49
+ env["WEBPACKER_CONFIG"] = "#{test_app_path}/config/webpacker.yml"
50
+ env["WEBPACK_DEV_SERVER"] = "true"
51
+ verify_command(cmd, env: env)
52
+ end
53
+
46
54
  private
47
55
  def test_app_path
48
56
  File.expand_path("test_app", __dir__)
49
57
  end
50
58
 
51
- def verify_command(cmd, use_node_modules: true, argv: [])
59
+ def verify_command(cmd, use_node_modules: true, argv: [], env: Webpacker::Compiler.env)
52
60
  cwd = Dir.pwd
53
61
  Dir.chdir(test_app_path)
54
62
 
55
63
  klass = Webpacker::DevServerRunner
56
64
  instance = klass.new(argv)
57
65
  mock = Minitest::Mock.new
58
- mock.expect(:call, nil, [Webpacker::Compiler.env, *cmd])
66
+ mock.expect(:call, nil, [env, *cmd])
59
67
 
60
68
  klass.stub(:new, instance) do
61
69
  instance.stub(:node_modules_bin_exist?, use_node_modules) do
data/test/helper_test.rb CHANGED
@@ -79,33 +79,6 @@ class HelperTest < ActionView::TestCase
79
79
  favicon_pack_tag("media/images/nested/mb-icon.png", rel: "apple-touch-icon", type: "image/png")
80
80
  end
81
81
 
82
- def test_javascript_pack_tag
83
- assert_equal \
84
- %(<script src="/packs/bootstrap-300631c4f0e0f9c865bc.js"></script>),
85
- javascript_pack_tag("bootstrap.js")
86
- end
87
-
88
- def test_javascript_pack_tag_symbol
89
- assert_equal \
90
- %(<script src="/packs/bootstrap-300631c4f0e0f9c865bc.js"></script>),
91
- javascript_pack_tag(:bootstrap)
92
- end
93
-
94
- def test_javascript_pack_tag_splat
95
- assert_equal \
96
- %(<script src="/packs/bootstrap-300631c4f0e0f9c865bc.js" defer="defer"></script>\n) +
97
- %(<script src="/packs/application-k344a6d59eef8632c9d1.js" defer="defer"></script>),
98
- javascript_pack_tag("bootstrap.js", "application.js", defer: true)
99
- end
100
-
101
- def test_javascript_pack_tag_split_chunks
102
- assert_equal \
103
- %(<script src="/packs/vendors~application~bootstrap-c20632e7baf2c81200d3.chunk.js"></script>\n) +
104
- %(<script src="/packs/vendors~application-e55f2aae30c07fb6d82a.chunk.js"></script>\n) +
105
- %(<script src="/packs/application-k344a6d59eef8632c9d1.js"></script>),
106
- javascript_packs_with_chunks_tag("application")
107
- end
108
-
109
82
  def test_preload_pack_asset
110
83
  if self.class.method_defined?(:preload_link_tag)
111
84
  assert_equal \
@@ -122,30 +95,51 @@ class HelperTest < ActionView::TestCase
122
95
  end
123
96
  end
124
97
 
125
- def test_stylesheet_pack_tag_split_chunks
98
+ def test_javascript_pack_tag
126
99
  assert_equal \
127
- %(<link rel="stylesheet" media="screen" href="/packs/1-c20632e7baf2c81200d3.chunk.css" />\n) +
128
- %(<link rel="stylesheet" media="screen" href="/packs/application-k344a6d59eef8632c9d1.chunk.css" />\n) +
129
- %(<link rel="stylesheet" media="screen" href="/packs/hello_stimulus-k344a6d59eef8632c9d1.chunk.css" />),
130
- stylesheet_packs_with_chunks_tag("application", "hello_stimulus")
100
+ %(<script src="/packs/vendors~application~bootstrap-c20632e7baf2c81200d3.chunk.js"></script>\n) +
101
+ %(<script src="/packs/vendors~application-e55f2aae30c07fb6d82a.chunk.js"></script>\n) +
102
+ %(<script src="/packs/application-k344a6d59eef8632c9d1.js"></script>\n) +
103
+ %(<script src="/packs/bootstrap-300631c4f0e0f9c865bc.js"></script>),
104
+ javascript_pack_tag("application", "bootstrap")
105
+ end
106
+
107
+ def test_javascript_pack_tag_splat
108
+ assert_equal \
109
+ %(<script src="/packs/vendors~application~bootstrap-c20632e7baf2c81200d3.chunk.js" defer="defer"></script>\n) +
110
+ %(<script src="/packs/vendors~application-e55f2aae30c07fb6d82a.chunk.js" defer="defer"></script>\n) +
111
+ %(<script src="/packs/application-k344a6d59eef8632c9d1.js" defer="defer"></script>),
112
+ javascript_pack_tag("application", defer: true)
113
+ end
114
+
115
+ def test_javascript_pack_tag_symbol
116
+ assert_equal \
117
+ %(<script src="/packs/vendors~application~bootstrap-c20632e7baf2c81200d3.chunk.js"></script>\n) +
118
+ %(<script src="/packs/vendors~application-e55f2aae30c07fb6d82a.chunk.js"></script>\n) +
119
+ %(<script src="/packs/application-k344a6d59eef8632c9d1.js"></script>),
120
+ javascript_pack_tag(:application)
131
121
  end
132
122
 
133
123
  def test_stylesheet_pack_tag
134
124
  assert_equal \
135
- %(<link rel="stylesheet" media="screen" href="/packs/bootstrap-c38deda30895059837cf.css" />),
136
- stylesheet_pack_tag("bootstrap.css")
125
+ %(<link rel="stylesheet" media="screen" href="/packs/1-c20632e7baf2c81200d3.chunk.css" />\n) +
126
+ %(<link rel="stylesheet" media="screen" href="/packs/application-k344a6d59eef8632c9d1.chunk.css" />\n) +
127
+ %(<link rel="stylesheet" media="screen" href="/packs/hello_stimulus-k344a6d59eef8632c9d1.chunk.css" />),
128
+ stylesheet_pack_tag("application", "hello_stimulus")
137
129
  end
138
130
 
139
131
  def test_stylesheet_pack_tag_symbol
140
132
  assert_equal \
141
- %(<link rel="stylesheet" media="screen" href="/packs/bootstrap-c38deda30895059837cf.css" />),
142
- stylesheet_pack_tag(:bootstrap)
133
+ %(<link rel="stylesheet" media="screen" href="/packs/1-c20632e7baf2c81200d3.chunk.css" />\n) +
134
+ %(<link rel="stylesheet" media="screen" href="/packs/application-k344a6d59eef8632c9d1.chunk.css" />\n) +
135
+ %(<link rel="stylesheet" media="screen" href="/packs/hello_stimulus-k344a6d59eef8632c9d1.chunk.css" />),
136
+ stylesheet_pack_tag(:application, :hello_stimulus)
143
137
  end
144
138
 
145
139
  def test_stylesheet_pack_tag_splat
146
140
  assert_equal \
147
- %(<link rel="stylesheet" media="all" href="/packs/bootstrap-c38deda30895059837cf.css" />\n) +
148
- %(<link rel="stylesheet" media="all" href="/packs/application-dd6b1cd38bfa093df600.css" />),
149
- stylesheet_pack_tag("bootstrap.css", "application.css", media: "all")
141
+ %(<link rel="stylesheet" media="all" href="/packs/1-c20632e7baf2c81200d3.chunk.css" />\n) +
142
+ %(<link rel="stylesheet" media="all" href="/packs/application-k344a6d59eef8632c9d1.chunk.css" />),
143
+ stylesheet_pack_tag("application", media: "all")
150
144
  end
151
145
  end