webpack-rails 0.9.4 → 0.9.5

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
  SHA1:
3
- metadata.gz: c813f2f67c3974956f8c4c14dd9a0d69b43487bc
4
- data.tar.gz: 8a037c81bcc49de4e8278dbd04d002bc10e7db26
3
+ metadata.gz: 747061130f0677dcd35cb81ddaa587573a8e0c97
4
+ data.tar.gz: 1adf1f455ae3f38a2c8631c1a294ab1fb6c8151a
5
5
  SHA512:
6
- metadata.gz: 6e423d0aa918c18dbdee048fcd3039dfa36911f21f24aad9d206c00cb5b6c40f84362cf13ebd079e92b4fcb845ac6088c724d7215ad94247967e3b441a794674
7
- data.tar.gz: 71fbfbfb3f67ef672c31b7ff2128a8627c0430cce13cac6f668c2496532fa04040680735fa3c8c1b214a472a354b44a45c9b79a6e279069a226898fd5a1bca8d
6
+ metadata.gz: 4721693b8b7a9fc1a75d39f5cd0aa7b0c8107b2f31e54b8745041f7473fa19fd4b31432449320361fd5bab295dcb0f97dce426dfbae8fdc323b069c6e4fc2ead
7
+ data.tar.gz: 500a27a4e74f77dc1bfed1ef93ca90f66ae9e0428f9cb555137b4e1009df2af20f48a584f5dfc41bc96d29b3364b1c638ef1a6cec3b52a566be5923ac19257b5
@@ -0,0 +1,4 @@
1
+ # Run Rails & Webpack concurrently
2
+ # Example file from webpack-rails gem
3
+ rails: bundle exec rails server
4
+ webpack: ./node_modules/.bin/webpack-dev-server --config config/webpack.config.js
@@ -0,0 +1,12 @@
1
+
2
+ # Ignore bundler config.
3
+ /.bundle
4
+
5
+ # Ignore all logfiles and tempfiles.
6
+ /log/*
7
+ !/log/.keep
8
+ /tmp
9
+
10
+ # Don't commit node_modules (vendored npm bits) or built assets
11
+ /node_modules
12
+ /public/webpack
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "webpack-rails-example",
3
+ "version": "0.0.1",
4
+ "license": "MIT",
5
+ "dependencies": {
6
+ "stats-webpack-plugin": "^0.2.1",
7
+ "webpack": "^1.9.11",
8
+ "webpack-dev-server": "^1.9.0"
9
+ }
10
+ }
@@ -0,0 +1,70 @@
1
+ // Example webpack configuration with asset fingerprinting in production.
2
+ 'use strict';
3
+
4
+ var path = require('path');
5
+ var webpack = require('webpack');
6
+ var StatsPlugin = require('stats-webpack-plugin');
7
+
8
+ // must match config.webpack.dev_server.port
9
+ var devServerPort = 3808;
10
+
11
+ // set TARGET=production on the environment to add asset fingerprints
12
+ var production = process.env.TARGET === 'production';
13
+
14
+ var config = {
15
+ entry: {
16
+ // Sources are expected to live in $app_root/webpack
17
+ 'application': './webpack/application.js'
18
+ },
19
+
20
+ output: {
21
+ // Build assets directly in to public/webpack/, let webpack know
22
+ // that all webpacked assets start with webpack/
23
+
24
+ // must match config.webpack.output_dir
25
+ path: path.join(__dirname, '..', 'public', 'webpack'),
26
+ publicPath: '/webpack/',
27
+
28
+ filename: production ? '[name]-[chunkhash].js' : '[name].js'
29
+ },
30
+
31
+ resolve: {
32
+ root: path.join(__dirname, '..', 'webpack')
33
+ },
34
+
35
+ plugins: [
36
+ // must match config.webpack.manifest_filename
37
+ new StatsPlugin('manifest.json', {
38
+ // We only need assetsByChunkName
39
+ chunkModules: false,
40
+ source: false,
41
+ chunks: false,
42
+ modules: false,
43
+ assets: true
44
+ })]
45
+ };
46
+
47
+ if (production) {
48
+ config.plugins.push(
49
+ new webpack.NoErrorsPlugin(),
50
+ new webpack.optimize.UglifyJsPlugin({
51
+ compressor: { warnings: false },
52
+ sourceMap: false
53
+ }),
54
+ new webpack.DefinePlugin({
55
+ 'process.env': { NODE_ENV: JSON.stringify('production') }
56
+ }),
57
+ new webpack.optimize.DedupePlugin(),
58
+ new webpack.optimize.OccurenceOrderPlugin()
59
+ );
60
+ } else {
61
+ config.devServer = {
62
+ port: devServerPort,
63
+ headers: { 'Access-Control-Allow-Origin': '*' }
64
+ };
65
+ config.output.publicPath = '//localhost:' + devServerPort + '/webpack/';
66
+ // Source maps
67
+ config.devtool = 'cheap-module-eval-source-map';
68
+ }
69
+
70
+ module.exports = config;
@@ -1,6 +1,6 @@
1
1
  module Webpack
2
2
  # :nodoc:
3
3
  module Rails
4
- VERSION = "0.9.4"
4
+ VERSION = "0.9.5"
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webpack-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Pearson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-22 00:00:00.000000000 Z
11
+ date: 2015-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -35,6 +35,10 @@ files:
35
35
  - MIT-LICENSE
36
36
  - README.md
37
37
  - Rakefile
38
+ - example/Procfile
39
+ - example/dot_gitignore
40
+ - example/package.json
41
+ - example/webpack.config.js
38
42
  - lib/generators/webpack_rails/install_generator.rb
39
43
  - lib/tasks/webpack.rake
40
44
  - lib/webpack/rails.rb