This repository has been archived by the owner on Dec 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(generators) Better defaults for generators. Closes #2
- Loading branch information
Showing
5 changed files
with
44 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Replace default Sprocket's directives with Webpack loaders! | ||
import 'script!imports?this=>window!jquery'; | ||
import 'script!jquery_ujs'; | ||
import 'script!coffee!turbolinks.js.coffee'; | ||
|
||
// Basically, if you're importing anything from sprockets, you'll want to use | ||
// the script-loader. While this is possible, it's best to move as many things | ||
// as you can to being managed by npm and Webpack. | ||
// | ||
// Sometimes you may run into Gem provided asset that has deep Sprocket's | ||
// directives. In this scenario, my best advice is to grab the precompiled asset | ||
// from sprockets via http://rails-app.dev/assets/some-asset.js, and copy into | ||
// your vendor folder at vendor/assets/javascripts/some-asset.js, and import it | ||
// using the script-loader. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
{ | ||
"name": "GeneratedByWebpackRails", | ||
"devDependencies": { | ||
"webpack-dev-server": "^1.6.6" | ||
}, | ||
"license": "MIT", | ||
"engines": { | ||
"node": ">= 0.10" | ||
}, | ||
"dependencies": { | ||
"6to5-loader": "^3.0.0", | ||
"assets-webpack-plugin": "^0.1.0", | ||
"es6-loader": "^0.2.0", | ||
"jsx-loader": "^0.12.2", | ||
"react": "^0.12.2", | ||
"webpack": "^1.4.14" | ||
"coffee-loader": "^0.7.2", | ||
"coffee-script": "^1.9.0", | ||
"exec-sync": "^0.1.6", | ||
"expose-loader": "^0.6.0", | ||
"imports-loader": "^0.6.3", | ||
"script-loader": "^0.6.1", | ||
"webpack": "^1.5.3", | ||
"webpack-dev-server": "^1.7.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
var config = require('./webpack.config.js'); | ||
var SaveAssetsJson = require('assets-webpack-plugin'); | ||
|
||
config.output.filename = "[chunkhash]-[name]"; | ||
config.output.filename = '[chunkhash]-[name]'; | ||
|
||
var plugin = new SaveAssetsJson({ | ||
path: config.output.path, | ||
filename: 'manifest.json' | ||
}); | ||
|
||
config.plugins = [plugin]; | ||
config.devtool = ''; | ||
|
||
module.exports = config; |