Created
June 1, 2019 03:07
-
-
Save DavidJRobertson/0229486414cb8d93d7c300770ad3fa6a to your computer and use it in GitHub Desktop.
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 is automatically compiled by Webpack, along with any other files | |
// present in this directory. You're encouraged to place your actual application logic in | |
// a relevant structure within app/javascript and only use these pack files to reference | |
// that code so it'll be compiled. | |
require("@rails/ujs").start() | |
require("turbolinks").start() | |
require("@rails/activestorage").start() | |
require("channels") | |
// Uncomment to copy all static images under ../images to the output folder and reference | |
// them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>) | |
// or the `imagePath` JavaScript helper below. | |
// | |
// const images = require.context('../images', true) | |
// const imagePath = (name) => images(name, true) | |
import "controllers" | |
require("trix") | |
require("@rails/actiontext") |
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
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 && [ | |
require('@babel/preset-env').default, | |
{ | |
targets: { | |
node: 'current' | |
} | |
} | |
], | |
(isProductionEnv || isDevelopmentEnv) && [ | |
require('@babel/preset-env').default, | |
{ | |
forceAllTransforms: true, | |
useBuiltIns: 'entry', | |
corejs: 3, | |
modules: false, | |
exclude: ['transform-typeof-symbol'] | |
} | |
] | |
].filter(Boolean), | |
plugins: [ | |
require('babel-plugin-macros'), | |
require('@babel/plugin-syntax-dynamic-import').default, | |
isTestEnv && require('babel-plugin-dynamic-import-node'), | |
require('@babel/plugin-transform-destructuring').default, | |
[ | |
require('@babel/plugin-proposal-class-properties').default, | |
{ | |
loose: true | |
} | |
], | |
[ | |
require('@babel/plugin-proposal-object-rest-spread').default, | |
{ | |
useBuiltIns: true | |
} | |
], | |
[ | |
require('@babel/plugin-transform-runtime').default, | |
{ | |
helpers: false, | |
regenerator: true, | |
corejs: 3 | |
} | |
], | |
[ | |
require('@babel/plugin-transform-regenerator').default, | |
{ | |
async: false | |
} | |
] | |
].filter(Boolean) | |
} | |
} |
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
const { environment } = require('@rails/webpacker') | |
//environment.loaders.delete('nodeModules') | |
module.exports = environment |
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
{ | |
"name": "LabNotebook", | |
"private": true, | |
"dependencies": { | |
"@rails/actioncable": "^6.0.0-alpha", | |
"@rails/actiontext": "^6.0.0-rc1", | |
"@rails/activestorage": "^6.0.0-alpha", | |
"@rails/ujs": "^6.0.0-alpha", | |
"@rails/webpacker": "^4.0.6", | |
"stimulus": "^1.1.1", | |
"trix": "^1.0.0", | |
"turbolinks": "^5.2.0" | |
}, | |
"version": "0.1.0", | |
"devDependencies": { | |
"webpack-dev-server": "^3.4.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment