opal-webpack-loader 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 36ee4b4cf00990f01430447febbf5e4653baa4943ba2a51291c99f823f693da2
4
- data.tar.gz: f49ae31c397e48d3ce57db5a8ecca450122a535c98a7f02f984cfde26d3a243b
3
+ metadata.gz: 5672a877b6ca466410a9bee1da91def498da0ca53ac5f8d8748f967a9712479b
4
+ data.tar.gz: 27aabbb8f2e7f8bb7a0e895e34f7ad33f871eb2f7fac8ad04e8d0166c4cd7b7a
5
5
  SHA512:
6
- metadata.gz: 42eab87b24e890cd9968d7ecbb0d972f165acdc8a48ea8a6924935f3e4849cf9349b66553165e7dc63c7d7bad9603e7203ed0c7dd81554259a48a773605ce12e
7
- data.tar.gz: dbf524e9ec8777290df3eb436ff9f890073eb83c458b03a70ad308644a7ec78236a4710d749fea9166706e55d6371e72b00988c10b45b2f340cb24a284a5f5b5
6
+ metadata.gz: c6b3b91f6711df267441402cbb773027f7fff58557a215c22a6768daebc77095909eca0c17133ec2f326b7b0ed0402c01363b76cc775a3710f30fb9f529df898
7
+ data.tar.gz: 7f795596a4d52556e1c8756286bcc94a4e45606f80b428d2a3c1721bf50f441fa3ef56ae4b5a25e0d05dc1b3d912e63839c1a1d9f99fb5832fa8b2808bce56bb
@@ -216,7 +216,11 @@ module OpalWebpackLoader
216
216
  File.write('Procfile', lines.join("\n"))
217
217
  end
218
218
  else
219
- create_file_from_template('Procfile.erb', 'Procfile',{})
219
+ erb_hash = { web_starter: '' }
220
+ if @js_entrypoints_directory.start_with?('app')
221
+ erb_hash[:web_starter] = 'web: bundle exec rails s'
222
+ end
223
+ create_file_from_template('Procfile.erb', 'Procfile',erb_hash)
220
224
  end
221
225
  end
222
226
 
@@ -1 +1,2 @@
1
1
  webpack: yarn run development
2
+ <%= web_starter %>
@@ -1,4 +1,4 @@
1
- env = defined? Rails ? Rails.env : 'development'
1
+ env = defined?(Rails) ? Rails.env : 'development'
2
2
 
3
3
  if env != 'development'
4
4
  OpalWebpackLoader.client_asset_path = '' # the full path is in the manifest already, like: /packs/website_packs-97fd9c2b7e7bdb112fc1.js
@@ -0,0 +1,54 @@
1
+ process.env.NODE_ENV = process.env.NODE_ENV || 'development';
2
+ const environment = require('./environment');
3
+ const chokidar = require('chokidar');
4
+ const OwlResolver = require('opal-webpack-loader/resolver');
5
+
6
+ const owl = {
7
+ test: /.(rb|js.rb)$/,
8
+ use: [
9
+ {
10
+ loader: 'opal-webpack-loader',
11
+ options: {
12
+ sourceMap: false,
13
+ hmr: true,
14
+ hmrHook: '<%= hmr_hook %>'
15
+ }
16
+ }
17
+ ]
18
+ };
19
+
20
+ environment.loaders.append('owlloader', owl);
21
+
22
+ environment.resolve.plugins.append('owlresolver', new OwlResolver('resolve', 'resolved'));
23
+
24
+ environment.devServer = {
25
+ before: function(app, server) {
26
+ // reload page for changes in app/views
27
+ chokidar.watch(path.resolve(__dirname, '../../app/views')).on('all', function () {
28
+ server.sockWrite(server.sockets, 'content-changed');
29
+ })
30
+ },
31
+ open: false,
32
+ lazy: false,
33
+ port: 3035,
34
+ hot: true,
35
+ // hotOnly: true,
36
+ inline: true,
37
+ https: false,
38
+ disableHostCheck: true,
39
+ headers: {
40
+ "Access-Control-Allow-Origin": "*",
41
+ "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
42
+ "Access-Control-Allow-Headers": "X-Requested-With, content-type, Authorization"
43
+ },
44
+ watchOptions: {
45
+ // in case of problems with hot reloading uncomment the following two lines:
46
+ // aggregateTimeout: 250,
47
+ // poll: 50,
48
+ ignored: /\bnode_modules\b/
49
+ },
50
+ contentBase: path.resolve(__dirname, 'public')
51
+ // watchContentBase: true
52
+ };
53
+
54
+ module.exports = environment;
@@ -1,3 +1,3 @@
1
1
  module OpalWebpackLoader
2
- VERSION="0.6.0"
2
+ VERSION="0.6.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opal-webpack-loader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann
@@ -164,6 +164,7 @@ files:
164
164
  - lib/opal-webpack-loader/templates/opal_loader.rb.erb
165
165
  - lib/opal-webpack-loader/templates/package.json.erb
166
166
  - lib/opal-webpack-loader/templates/production.js.erb
167
+ - lib/opal-webpack-loader/templates/webpacker_development.js_example
167
168
  - lib/opal-webpack-loader/version.rb
168
169
  - lib/opal-webpack-loader/view_helper.rb
169
170
  - spec/fixtures/flattering/Gemfile