-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replaced webpacker -> jsbundling-rails
- Loading branch information
1 parent
e30ad23
commit c7ac679
Showing
22 changed files
with
589 additions
and
5,495 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
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,2 @@ | ||
web: bin/rails server -p 3000 | ||
js: yarn build --watch |
Empty file.
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 +1,2 @@ | ||
//= link_tree ../images | ||
//= link_tree ../builds |
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
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,82 +1 @@ | ||
module.exports = function(api) { | ||
var validEnv = ['development', 'test', 'production'] | ||
var currentEnv = api.env() | ||
var isDevelopmentEnv = api.env('development') | ||
var isProductionEnv = api.env('production') | ||
var isTestEnv = api.env('test') | ||
|
||
if (!validEnv.includes(currentEnv)) { | ||
throw new Error( | ||
'Please specify a valid `NODE_ENV` or ' + | ||
'`BABEL_ENV` environment variables. Valid values are "development", ' + | ||
'"test", and "production". Instead, received: ' + | ||
JSON.stringify(currentEnv) + | ||
'.' | ||
) | ||
} | ||
|
||
return { | ||
presets: [ | ||
isTestEnv && [ | ||
'@babel/preset-env', | ||
{ | ||
targets: { | ||
node: 'current' | ||
} | ||
} | ||
], | ||
(isProductionEnv || isDevelopmentEnv) && [ | ||
'@babel/preset-env', | ||
{ | ||
forceAllTransforms: true, | ||
useBuiltIns: 'entry', | ||
corejs: 3, | ||
modules: false, | ||
exclude: ['transform-typeof-symbol'] | ||
} | ||
] | ||
].filter(Boolean), | ||
plugins: [ | ||
'babel-plugin-macros', | ||
'@babel/plugin-syntax-dynamic-import', | ||
isTestEnv && 'babel-plugin-dynamic-import-node', | ||
'@babel/plugin-transform-destructuring', | ||
[ | ||
'@babel/plugin-proposal-class-properties', | ||
{ | ||
loose: true | ||
} | ||
], | ||
[ | ||
'@babel/plugin-proposal-object-rest-spread', | ||
{ | ||
useBuiltIns: true | ||
} | ||
], | ||
[ | ||
'@babel/plugin-proposal-private-methods', | ||
{ | ||
loose: true | ||
} | ||
], | ||
[ | ||
'@babel/plugin-proposal-private-property-in-object', | ||
{ | ||
loose: true | ||
} | ||
], | ||
[ | ||
'@babel/plugin-transform-runtime', | ||
{ | ||
helpers: false | ||
} | ||
], | ||
[ | ||
'@babel/plugin-transform-regenerator', | ||
{ | ||
async: false | ||
} | ||
] | ||
].filter(Boolean) | ||
} | ||
} | ||
presets: ["@babel/preset-env"] |
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,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
if ! foreman version &> /dev/null | ||
then | ||
echo "Installing foreman..." | ||
gem install foreman | ||
fi | ||
|
||
foreman start -f Procfile.dev "$@" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,66 @@ | ||
const path = require("path") | ||
const webpack = require("webpack") | ||
|
||
// CSS/SASS | ||
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); | ||
const RemoveEmptyScriptsPlugin = require('webpack-remove-empty-scripts'); | ||
|
||
// mode | ||
const mode = process.env.NODE_ENV === 'production' ? 'production' : 'development'; | ||
|
||
module.exports = { | ||
mode, | ||
devtool: "source-map", | ||
entry: { | ||
application: [ | ||
"./app/frontend/packs/application.js", | ||
"./app/frontend/stylesheets/application.scss", | ||
] | ||
}, | ||
output: { | ||
filename: "[name].js", | ||
sourceMapFilename: "[file].map", | ||
path: path.resolve(__dirname, "..", "..", "app/assets/builds"), | ||
}, | ||
plugins: [ | ||
new webpack.optimize.LimitChunkCountPlugin({ | ||
maxChunks: 1 | ||
}), | ||
new webpack.ProvidePlugin({ | ||
$: 'jquery', | ||
jQuery: 'jquery' | ||
}), | ||
// CSS/SASS | ||
new RemoveEmptyScriptsPlugin(), | ||
new MiniCssExtractPlugin(), | ||
], | ||
module: { | ||
rules: [ | ||
// babel | ||
{ | ||
test: /\.m?js$/, | ||
exclude: /node_modules/, | ||
use: { | ||
loader: "babel-loader", | ||
options: { | ||
presets: ['@babel/preset-env'] | ||
} | ||
} | ||
}, | ||
// Add CSS/SASS/SCSS rule with loaders | ||
{ | ||
test: /\.(?:sa|sc|c)ss$/i, | ||
use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader'], | ||
}, | ||
], | ||
}, | ||
resolve: { | ||
// Add additional file types | ||
extensions: ['.js', '.jsx', '.scss', '.css'], | ||
alias: { | ||
'@js': path.resolve(__dirname, '..', '..', 'app/frontend', 'javascripts'), | ||
'@components': path.resolve(__dirname, '..', '..', 'app/frontend', 'javascripts', 'components'), | ||
'@css': path.resolve(__dirname, '..', '..', 'app/frontend', 'stylesheets') | ||
} | ||
} | ||
} |
Oops, something went wrong.