Commit 2caedc3c authored by Genar Trias Ortiz's avatar Genar Trias Ortiz 🎉

fixed production build

parent 1b6493ae
Pipeline #51129472 failed with stages
in 5 minutes and 47 seconds
......@@ -88,9 +88,8 @@ module.exports = {
// https://github.com/facebookincubator/create-react-app/issues/290
// `web` extension prefixes have been added for better support
// for React Native Web.
extensions: ['.web.js', '.mjs', '.js', '.json', '.web.jsx', '.jsx'],
extensions: ['.web.js', '.mjs', '.js', '.json', '.web.jsx', '.jsx', '.ts', '.tsx'],
alias: {
// Support React Native Web
// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
'react-native': 'react-native-web',
......@@ -114,7 +113,7 @@ module.exports = {
// First, run the linter.
// It's important to do this before Babel processes the JS.
{
test: /\.(js|jsx|mjs)$/,
test: /\.(js|jsx|mjs|ts|tsx)$/,
enforce: 'pre',
use: [
{
......@@ -143,6 +142,16 @@ module.exports = {
name: 'static/media/[name].[ext]',
},
},
// Typescript
{
test: /\.tsx?$/,
exclude: /node_modules/,
loader: 'ts-loader',
include: paths.appSrc,
options: {
configFile: "tsconfig.prod.json"
}
},
// Process JS with Babel.
{
test: /\.(js|jsx|mjs)$/,
......@@ -153,12 +162,6 @@ module.exports = {
compact: true,
},
},
// Typescript
{
test: /\.(ts|tsx)$/,
loader: 'ts-loader',
include: paths.appSrc,
},
// SASS support
{
test: /\.scss$/,
......@@ -193,7 +196,6 @@ module.exports = {
loader: require.resolve('css-loader'),
options: {
importLoaders: 1,
minimize: true,
sourceMap: shouldUseSourceMap,
},
},
......@@ -234,7 +236,7 @@ module.exports = {
// it's runtime that would otherwise processed through "file" loader.
// Also exclude `html` and `json` extensions so they get processed
// by webpacks internal loaders.
exclude: [/\.(js|jsx|mjs)$/, /\.html$/, /\.json$/],
exclude: [/\.(js|jsx|mjs|ts|tsx)$/, /\.html$/, /\.json$/],
options: {
name: 'static/media/[name].[ext]',
},
......
// Learn more about using JavaScript to interact with webpages:
// https://developer.mozilla.org/en-US/docs/Web/javascript
const COLORS = [
'rebeccapurple',
'magenta',
'lime',
'violet',
'red',
'cyan',
'yellow',
'springgreen',
'aqua',
'orange',
'crimson',
'coral',
'deeppink',
'dodgerblue',
'gold'
]
const button = document.getElementById('change-background-color')
button.addEventListener('click', changeBackgroundColor)
document.addEventListener('DOMContentLoaded', function () {
document.getElementById('url').innerText = window.location
document.getElementById('library-url').href = `beaker://library/${window.location}`
// is this a Dat-supported website? If so, use a dat:// URL for the beakerbrowser.com link
const beakerLink = document.getElementById('beaker-url')
if (window.DatArchive) {
beakerLink.href = 'dat://beakerbrowser.com'
} else {
beakerLink.href = 'https://beakerbrowser.com'
}
})
function changeBackgroundColor () {
const maxIdx = COLORS.length - 1
const idx = Math.floor(Math.random() * Math.floor(maxIdx))
const newColor = COLORS[idx]
document.body.style.background = newColor
}
\ No newline at end of file
......@@ -95,6 +95,7 @@ measureFileSizesBeforeBuild(paths.appBuild)
},
err => {
console.log(chalk.red('Failed to compile.\n'));
console.log(err)
printBuildError(err);
process.exit(1);
}
......
// @flow
import configureMockStore from 'redux-mock-store'
import thunk from 'redux-thunk'
import {
SET_CURRENT_PLAYING,
ADD_SONGS_TO_PLAYLIST
} from '../constants/ActionTypes'
import Song from '../entities/Song'
import * as actions from './playlist'
......
// @flow
import { Dispatch } from 'redux'
import * as types from '../constants/ActionTypes'
......
// @flow
import configureMockStore from 'redux-mock-store'
import thunk from 'redux-thunk'
......
// @flow
import { Dispatch } from 'redux'
import * as types from '../constants/ActionTypes'
......
import * as React from 'react';
import * as React from 'react'
import * as ReactDOM from 'react-dom'
import App from './App';
import registerServiceWorker from './registerServiceWorker';
import App from './App'
import registerServiceWorker from './registerServiceWorker'
ReactDOM.render(<App />, document.getElementById('root'))
......
/*
* Want to change this website's styes? Learn more about CSS:
* https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS
*/
body {
padding: 0 20px;
background: aliceblue;
}
\ No newline at end of file
......@@ -3,6 +3,10 @@
"sourceMap": true,
"strictNullChecks": true,
"module": "es6",
"lib": [
"es6",
"dom"
],
"jsx": "react",
"moduleResolution": "node",
"resolveJsonModule": true,
......
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"sourceMap": false
},
"extends": "./tsconfig.json"
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment