webpacker 3.1.1 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +77 -0
- data/Gemfile.lock +17 -18
- data/README.md +21 -0
- data/docs/css.md +8 -3
- data/docs/troubleshooting.md +18 -0
- data/docs/webpack.md +30 -3
- data/lib/install/angular.rb +12 -0
- data/lib/install/coffee.rb +22 -0
- data/lib/install/config/.postcssrc.yml +1 -1
- data/lib/install/elm.rb +12 -0
- data/lib/install/erb.rb +22 -0
- data/lib/install/examples/coffee/hello_coffee.coffee +4 -0
- data/lib/install/examples/erb/hello_erb.js.erb +6 -0
- data/{package/rules → lib/install/loaders}/coffee.js +0 -0
- data/{package/rules → lib/install/loaders}/elm.js +0 -0
- data/{package/rules → lib/install/loaders}/erb.js +0 -0
- data/{package/rules → lib/install/loaders}/typescript.js +0 -0
- data/{package/rules → lib/install/loaders}/vue.js +1 -1
- data/lib/install/vue.rb +12 -0
- data/lib/tasks/installers.rake +3 -1
- data/lib/tasks/webpacker.rake +3 -1
- data/lib/tasks/webpacker/check_node.rake +2 -6
- data/lib/webpacker/compiler.rb +6 -1
- data/lib/webpacker/configuration.rb +8 -0
- data/lib/webpacker/helper.rb +14 -2
- data/lib/webpacker/version.rb +1 -1
- data/package.json +4 -10
- data/package/__tests__/environment.js +74 -0
- data/package/config.js +3 -0
- data/package/config_types/config_list.js +2 -0
- data/package/environment.js +6 -9
- data/package/environments/development.js +3 -4
- data/package/index.js +1 -2
- data/package/rules/file.js +1 -3
- data/package/rules/index.js +0 -12
- data/test/compiler_test.rb +11 -0
- data/test/configuration_test.rb +8 -0
- data/test/helper_test.rb +8 -0
- data/test/test_app/app/javascript/packs/application.js +10 -0
- data/test/test_app/config/webpacker.yml +65 -0
- data/test/test_helper.rb +1 -1
- data/yarn.lock +100 -188
- metadata +16 -9
- data/package/asset_host.js +0 -20
- data/package/rules/url.js +0 -13
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webpacker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-12-
|
12
|
+
date: 2017-12-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -111,6 +111,7 @@ files:
|
|
111
111
|
- gemfiles/Gemfile-rails.5.0.x
|
112
112
|
- gemfiles/Gemfile-rails.5.1.x
|
113
113
|
- lib/install/angular.rb
|
114
|
+
- lib/install/coffee.rb
|
114
115
|
- lib/install/config/.babelrc
|
115
116
|
- lib/install/config/.postcssrc.yml
|
116
117
|
- lib/install/config/webpack/development.js
|
@@ -119,19 +120,27 @@ files:
|
|
119
120
|
- lib/install/config/webpack/test.js
|
120
121
|
- lib/install/config/webpacker.yml
|
121
122
|
- lib/install/elm.rb
|
123
|
+
- lib/install/erb.rb
|
122
124
|
- lib/install/examples/angular/hello_angular.js
|
123
125
|
- lib/install/examples/angular/hello_angular/app/app.component.ts
|
124
126
|
- lib/install/examples/angular/hello_angular/app/app.module.ts
|
125
127
|
- lib/install/examples/angular/hello_angular/index.ts
|
126
128
|
- lib/install/examples/angular/hello_angular/polyfills.ts
|
127
129
|
- lib/install/examples/angular/tsconfig.json
|
130
|
+
- lib/install/examples/coffee/hello_coffee.coffee
|
128
131
|
- lib/install/examples/elm/Main.elm
|
129
132
|
- lib/install/examples/elm/hello_elm.js
|
133
|
+
- lib/install/examples/erb/hello_erb.js.erb
|
130
134
|
- lib/install/examples/react/.babelrc
|
131
135
|
- lib/install/examples/react/hello_react.jsx
|
132
136
|
- lib/install/examples/vue/app.vue
|
133
137
|
- lib/install/examples/vue/hello_vue.js
|
134
138
|
- lib/install/javascript/packs/application.js
|
139
|
+
- lib/install/loaders/coffee.js
|
140
|
+
- lib/install/loaders/elm.js
|
141
|
+
- lib/install/loaders/erb.js
|
142
|
+
- lib/install/loaders/typescript.js
|
143
|
+
- lib/install/loaders/vue.js
|
135
144
|
- lib/install/react.rb
|
136
145
|
- lib/install/template.rb
|
137
146
|
- lib/install/vue.rb
|
@@ -160,7 +169,7 @@ files:
|
|
160
169
|
- lib/webpacker/version.rb
|
161
170
|
- lib/webpacker/webpack_runner.rb
|
162
171
|
- package.json
|
163
|
-
- package/
|
172
|
+
- package/__tests__/environment.js
|
164
173
|
- package/config.js
|
165
174
|
- package/config_types/__tests__/config_list.js
|
166
175
|
- package/config_types/__tests__/config_object.js
|
@@ -173,16 +182,10 @@ files:
|
|
173
182
|
- package/environments/test.js
|
174
183
|
- package/index.js
|
175
184
|
- package/rules/babel.js
|
176
|
-
- package/rules/coffee.js
|
177
185
|
- package/rules/css.js
|
178
|
-
- package/rules/elm.js
|
179
|
-
- package/rules/erb.js
|
180
186
|
- package/rules/file.js
|
181
187
|
- package/rules/index.js
|
182
188
|
- package/rules/sass.js
|
183
|
-
- package/rules/typescript.js
|
184
|
-
- package/rules/url.js
|
185
|
-
- package/rules/vue.js
|
186
189
|
- package/utils/__tests__/deep_assign.js
|
187
190
|
- package/utils/__tests__/deep_merge.js
|
188
191
|
- package/utils/__tests__/objectify.js
|
@@ -198,8 +201,10 @@ files:
|
|
198
201
|
- test/manifest_test.rb
|
199
202
|
- test/rake_tasks_test.rb
|
200
203
|
- test/test_app/Rakefile
|
204
|
+
- test/test_app/app/javascript/packs/application.js
|
201
205
|
- test/test_app/config/application.rb
|
202
206
|
- test/test_app/config/environment.rb
|
207
|
+
- test/test_app/config/webpacker.yml
|
203
208
|
- test/test_app/public/packs/manifest.json
|
204
209
|
- test/test_helper.rb
|
205
210
|
- webpacker.gemspec
|
@@ -237,7 +242,9 @@ test_files:
|
|
237
242
|
- test/manifest_test.rb
|
238
243
|
- test/rake_tasks_test.rb
|
239
244
|
- test/test_app/Rakefile
|
245
|
+
- test/test_app/app/javascript/packs/application.js
|
240
246
|
- test/test_app/config/application.rb
|
241
247
|
- test/test_app/config/environment.rb
|
248
|
+
- test/test_app/config/webpacker.yml
|
242
249
|
- test/test_app/public/packs/manifest.json
|
243
250
|
- test/test_helper.rb
|
data/package/asset_host.js
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
const config = require('./config')
|
2
|
-
const { resolve } = require('path')
|
3
|
-
|
4
|
-
const removeOuterSlashes = string =>
|
5
|
-
string.replace(/^\/*/, '').replace(/\/*$/, '')
|
6
|
-
|
7
|
-
const formatPublicPath = (host = '', path = '') => {
|
8
|
-
let formattedHost = removeOuterSlashes(host)
|
9
|
-
if (formattedHost && !/^http/i.test(formattedHost)) {
|
10
|
-
formattedHost = `//${formattedHost}`
|
11
|
-
}
|
12
|
-
const formattedPath = removeOuterSlashes(path)
|
13
|
-
return `${formattedHost}/${formattedPath}/`
|
14
|
-
}
|
15
|
-
|
16
|
-
module.exports = {
|
17
|
-
path: resolve('public', config.public_output_path),
|
18
|
-
publicPath: `/${config.public_output_path}/`.replace(/([^:]\/)\/+/g, '$1'),
|
19
|
-
publicPathWithHost: formatPublicPath(process.env.WEBPACKER_ASSET_HOST, config.public_output_path)
|
20
|
-
}
|
data/package/rules/url.js
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
const assetHost = require('../asset_host')
|
2
|
-
|
3
|
-
module.exports = {
|
4
|
-
test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/],
|
5
|
-
use: [{
|
6
|
-
loader: 'url-loader',
|
7
|
-
options: {
|
8
|
-
limit: 10000,
|
9
|
-
name: '[name]-[hash].[ext]',
|
10
|
-
publicPath: assetHost.publicPathWithHost
|
11
|
-
}
|
12
|
-
}]
|
13
|
-
}
|