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 +4 -4
- data/example/Procfile +4 -0
- data/example/dot_gitignore +12 -0
- data/example/package.json +10 -0
- data/example/webpack.config.js +70 -0
- data/lib/webpack/rails/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 747061130f0677dcd35cb81ddaa587573a8e0c97
|
4
|
+
data.tar.gz: 1adf1f455ae3f38a2c8631c1a294ab1fb6c8151a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4721693b8b7a9fc1a75d39f5cd0aa7b0c8107b2f31e54b8745041f7473fa19fd4b31432449320361fd5bab295dcb0f97dce426dfbae8fdc323b069c6e4fc2ead
|
7
|
+
data.tar.gz: 500a27a4e74f77dc1bfed1ef93ca90f66ae9e0428f9cb555137b4e1009df2af20f48a584f5dfc41bc96d29b3364b1c638ef1a6cec3b52a566be5923ac19257b5
|
data/example/Procfile
ADDED
@@ -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;
|
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
|
+
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-
|
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
|