No longer need to put ruffle stuff in source tree. Made ruffle not use

polyfills also.
This commit is contained in:
Henry Jameson 2021-04-11 23:03:03 +03:00
parent d695dcaff9
commit 2f549774ab
9 changed files with 633 additions and 214 deletions

View file

@ -21,6 +21,7 @@ var compiler = webpack(webpackConfig)
var devMiddleware = require('webpack-dev-middleware')(compiler, {
publicPath: webpackConfig.output.publicPath,
writeToDisk: true,
stats: {
colors: true,
chunks: false

View file

@ -3,6 +3,7 @@ var config = require('../config')
var utils = require('./utils')
var projectRoot = path.resolve(__dirname, '../')
var ServiceWorkerWebpackPlugin = require('serviceworker-webpack-plugin')
var CopyPlugin = require('copy-webpack-plugin');
var env = process.env.NODE_ENV
// check env & config/index.js to decide weither to enable CSS Sourcemaps for the
@ -93,6 +94,19 @@ module.exports = {
new ServiceWorkerWebpackPlugin({
entry: path.join(__dirname, '..', 'src/sw.js'),
filename: 'sw-pleroma.js'
}),
// This copies Ruffle's WASM to a directory so that JS side can access it
new CopyPlugin({
patterns: [
{
from: "node_modules/ruffle-mirror/*",
to: "static/ruffle",
flatten: true
},
],
options: {
concurrency: 100,
},
})
]
}

View file

@ -5,7 +5,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no">
<!--server-generated-meta-->
<link rel="icon" type="image/png" href="/favicon.png">
<script src="/static/js/ruffle.js"></script>
</head>
<body class="hidden">
<noscript>To use Pleroma, please enable JavaScript.</noscript>

View file

@ -32,6 +32,7 @@
"phoenix": "^1.3.0",
"portal-vue": "^2.1.4",
"punycode.js": "^2.1.0",
"ruffle-mirror": "^2021.4.10",
"v-click-outside": "^2.1.1",
"vue": "^2.6.11",
"vue-i18n": "^7.3.2",
@ -57,6 +58,7 @@
"chalk": "^1.1.3",
"chromedriver": "^87.0.1",
"connect-history-api-fallback": "^1.1.0",
"copy-webpack-plugin": "^6.4.1",
"cross-spawn": "^4.0.2",
"css-loader": "^0.28.0",
"custom-event-polyfill": "^1.0.7",
@ -111,7 +113,7 @@
"url-loader": "^1.1.2",
"vue-loader": "^14.0.0",
"vue-style-loader": "^4.0.0",
"webpack": "^4.0.0",
"webpack": "^4.44.0",
"webpack-dev-middleware": "^3.6.0",
"webpack-hot-middleware": "^2.12.2",
"webpack-merge": "^0.14.1"

View file

@ -1,14 +1,15 @@
import RuffleService from '../../services/ruffle_service/ruffle_service.js'
const Flash = {
props: [
'src'
],
created: function () {
props: [ 'src' ],
created () {
this.$nextTick(function () {
const ruffle = window.RufflePlayer.newest()
const player = ruffle.createPlayer()
const container = this.$refs.cunt
container.appendChild(player)
player.load(this.src)
RuffleService.getRuffle().then((ruffle) => {
const player = ruffle.newest().createPlayer()
const container = this.$refs.cunt
container.appendChild(player)
player.load(this.src)
})
})
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

805
yarn.lock

File diff suppressed because it is too large Load diff