Add React and TS to webpacker; add react-rails gem

This commit is contained in:
riggraz
2019-08-25 14:34:20 +02:00
parent 01cc6eb96a
commit 24339c0e08
14 changed files with 304 additions and 7 deletions

View File

@@ -1,6 +1,8 @@
const { environment } = require('@rails/webpacker')
const typescript = require('./loaders/typescript')
const webpack = require('webpack')
environment.loaders.prepend('typescript', typescript)
environment.plugins.append(
'Provide',
new webpack.ProvidePlugin({

View File

@@ -0,0 +1,11 @@
const PnpWebpackPlugin = require('pnp-webpack-plugin')
module.exports = {
test: /\.(ts|tsx)?(\.erb)?$/,
use: [
{
loader: 'ts-loader',
options: PnpWebpackPlugin.tsLoaderOptions()
}
]
}

View File

@@ -34,6 +34,9 @@ default: &default
- .woff2
extensions:
- .tsx
- .ts
- .jsx
- .mjs
- .js
- .sass