Remove webpack
This commit is contained in:
@@ -74,7 +74,7 @@ jobs:
|
||||
name: yarn
|
||||
command: yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
|
||||
|
||||
# Store yarn / webpacker cache
|
||||
# Store yarn cache
|
||||
- save_cache:
|
||||
key: chatwoot-yarn-{{ .Environment.CACHE_VERSION }}-{{ checksum "yarn.lock" }}
|
||||
paths:
|
||||
|
||||
@@ -3,10 +3,10 @@ sed -i -e '/REDIS_URL/ s/=.*/=redis:\/\/localhost:6379/' .env
|
||||
sed -i -e '/POSTGRES_HOST/ s/=.*/=localhost/' .env
|
||||
sed -i -e '/SMTP_ADDRESS/ s/=.*/=localhost/' .env
|
||||
sed -i -e "/FRONTEND_URL/ s/=.*/=https:\/\/$CODESPACE_NAME-3000.githubpreview.dev/" .env
|
||||
sed -i -e "/WEBPACKER_DEV_SERVER_PUBLIC/ s/=.*/=https:\/\/$CODESPACE_NAME-3035.githubpreview.dev/" .env
|
||||
# uncomment the webpacker env variable
|
||||
sed -i -e '/WEBPACKER_DEV_SERVER_PUBLIC/s/^# //' .env
|
||||
# fix the error with webpacker
|
||||
sed -i -e "/DEV_SERVER_PUBLIC/ s/=.*/=https:\/\/$CODESPACE_NAME-3035.githubpreview.dev/" .env
|
||||
# uncomment the dev server env variable
|
||||
sed -i -e '/DEV_SERVER_PUBLIC/s/^# //' .env
|
||||
# fix the error with dev server
|
||||
echo 'export NODE_OPTIONS=--openssl-legacy-provider' >> ~/.zshrc
|
||||
|
||||
# codespaces make the ports public
|
||||
|
||||
+1
-1
@@ -223,7 +223,7 @@ ANDROID_SHA256_CERT_FINGERPRINT=AC:73:8E:DE:EB:56:EA:CC:10:87:02:A7:65:37:7B:38:
|
||||
# if you want to use letter_opener for local emails
|
||||
# LETTER_OPENER=true
|
||||
# meant to be used in github codespaces
|
||||
# WEBPACKER_DEV_SERVER_PUBLIC=
|
||||
# DEV_SERVER_PUBLIC=
|
||||
|
||||
# If you want to use official mobile app,
|
||||
# the notifications would be relayed via a Chatwoot server
|
||||
|
||||
@@ -56,13 +56,6 @@ module.exports = {
|
||||
'import/extensions': ['off'],
|
||||
'no-console': 'error',
|
||||
},
|
||||
settings: {
|
||||
'import/resolver': {
|
||||
webpack: {
|
||||
config: 'config/webpack/resolve.js',
|
||||
},
|
||||
},
|
||||
},
|
||||
env: {
|
||||
browser: true,
|
||||
jest: true,
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
backend: RAILS_ENV=test bin/rails s -p 5050
|
||||
frontend: export NODE_OPTIONS=--openssl-legacy-provider && bin/webpack-dev-server
|
||||
frontend: bin/vite
|
||||
worker: RAILS_ENV=test dotenv bundle exec sidekiq -C config/sidekiq.yml
|
||||
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
ENV['RAILS_ENV'] ||= ENV['RACK_ENV'] || 'development'
|
||||
ENV['NODE_ENV'] ||= 'development'
|
||||
|
||||
require 'pathname'
|
||||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
|
||||
Pathname.new(__FILE__).realpath)
|
||||
|
||||
require 'rubygems'
|
||||
require 'bundler/setup'
|
||||
|
||||
require 'webpacker'
|
||||
require 'webpacker/webpack_runner'
|
||||
|
||||
APP_ROOT = File.expand_path('..', __dir__)
|
||||
Dir.chdir(APP_ROOT) do
|
||||
Webpacker::WebpackRunner.run(ARGV)
|
||||
end
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
ENV['RAILS_ENV'] ||= ENV['RACK_ENV'] || 'development'
|
||||
ENV['NODE_ENV'] ||= 'development'
|
||||
|
||||
require 'pathname'
|
||||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
|
||||
Pathname.new(__FILE__).realpath)
|
||||
|
||||
require 'rubygems'
|
||||
require 'bundler/setup'
|
||||
|
||||
require 'webpacker'
|
||||
require 'webpacker/dev_server_runner'
|
||||
|
||||
APP_ROOT = File.expand_path('..', __dir__)
|
||||
Dir.chdir(APP_ROOT) do
|
||||
Webpacker::DevServerRunner.run(ARGV)
|
||||
end
|
||||
@@ -10,20 +10,18 @@
|
||||
# policy.img_src :self, :https, :data
|
||||
# policy.object_src :none
|
||||
# policy.script_src :self, :https
|
||||
|
||||
# Allow @vite/client to hot reload javascript changes in development
|
||||
# policy.script_src *policy.script_src, :unsafe_eval, "http://#{ ViteRuby.config.host_with_port }" if Rails.env.development?
|
||||
|
||||
# You may need to enable this in production as well depending on your setup.
|
||||
# policy.script_src *policy.script_src, :blob if Rails.env.test?
|
||||
# policy.script_src *policy.script_src, :blob if Rails.env.test?
|
||||
|
||||
# policy.style_src :self, :https
|
||||
# Allow @vite/client to hot reload style changes in development
|
||||
# policy.style_src *policy.style_src, :unsafe_inline if Rails.env.development?
|
||||
# policy.style_src *policy.style_src, :unsafe_inline if Rails.env.development?
|
||||
|
||||
# # If you are using webpack-dev-server then specify webpack-dev-server host
|
||||
# policy.connect_src :self, :https, "http://localhost:3035", "ws://localhost:3035" if Rails.env.development?
|
||||
# Allow @vite/client to hot reload changes in development
|
||||
# policy.connect_src *policy.connect_src, "ws://#{ ViteRuby.config.host_with_port }" if Rails.env.development?
|
||||
# policy.connect_src *policy.connect_src, "ws://#{ ViteRuby.config.host_with_port }" if Rails.env.development?
|
||||
|
||||
# # Specify URI for violation reports
|
||||
# # policy.report_uri "/csp-violation-report-endpoint"
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
|
||||
|
||||
const environment = require('./environment');
|
||||
|
||||
module.exports = environment.toWebpackConfig();
|
||||
@@ -1,65 +0,0 @@
|
||||
const { environment } = require('@rails/webpacker');
|
||||
const { VueLoaderPlugin } = require('vue-loader');
|
||||
const resolve = require('./resolve');
|
||||
const vue = require('./loaders/vue');
|
||||
|
||||
// Implementation reference: https://chwt.app/webpacker-tailwind-jit
|
||||
const sassLoader = environment.loaders.get('sass');
|
||||
const sassLoaderConfig = sassLoader.use.find(
|
||||
element => element.loader === 'sass-loader'
|
||||
);
|
||||
|
||||
const options = sassLoaderConfig.options;
|
||||
options.implementation = require('sass');
|
||||
|
||||
const hotfixPostcssLoaderConfig = subloader => {
|
||||
const subloaderName = subloader.loader;
|
||||
if (subloaderName === 'postcss-loader') {
|
||||
subloader.options.postcssOptions = subloader.options.config;
|
||||
delete subloader.options.config;
|
||||
}
|
||||
};
|
||||
|
||||
environment.loaders.keys().forEach(loaderName => {
|
||||
const loader = environment.loaders.get(loaderName);
|
||||
loader.use.forEach(hotfixPostcssLoaderConfig);
|
||||
});
|
||||
|
||||
environment.plugins.prepend('VueLoaderPlugin', new VueLoaderPlugin());
|
||||
environment.loaders.prepend('vue', vue);
|
||||
|
||||
environment.loaders.append('opus-ogg', {
|
||||
test: /encoderWorker\.min\.js$/,
|
||||
loader: 'file-loader',
|
||||
options: {
|
||||
name: '[name].[ext]',
|
||||
},
|
||||
});
|
||||
|
||||
environment.loaders.append('opus-wav', {
|
||||
test: /waveWorker\.min\.js$/,
|
||||
loader: 'file-loader',
|
||||
options: {
|
||||
name: '[name].[ext]',
|
||||
},
|
||||
});
|
||||
|
||||
environment.loaders.append('audio', {
|
||||
test: /\.(mp3)(\?.*)?$/,
|
||||
loader: 'url-loader',
|
||||
query: {
|
||||
limit: 10000,
|
||||
name: 'audio/[name].[ext]',
|
||||
},
|
||||
});
|
||||
|
||||
const preserveNameFor = ['sdk', 'worker'];
|
||||
|
||||
environment.config.merge({ resolve });
|
||||
environment.config.set('output.filename', chunkData => {
|
||||
return preserveNameFor.includes(chunkData.chunk.name)
|
||||
? 'js/[name].js'
|
||||
: 'js/[name]-[hash].js';
|
||||
});
|
||||
|
||||
module.exports = environment;
|
||||
@@ -1,6 +0,0 @@
|
||||
module.exports = {
|
||||
test: /\.vue(\.erb)?$/,
|
||||
use: [{
|
||||
loader: 'vue-loader'
|
||||
}]
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
process.env.NODE_ENV = process.env.NODE_ENV || 'production'
|
||||
|
||||
const environment = require('./environment')
|
||||
|
||||
module.exports = environment.toWebpackConfig()
|
||||
@@ -1,20 +0,0 @@
|
||||
const path = require('path');
|
||||
|
||||
const resolve = {
|
||||
extensions: ['.js', '.vue'],
|
||||
alias: {
|
||||
vue$: 'vue/dist/vue.common.js',
|
||||
dashboard: path.resolve('./app/javascript/dashboard'),
|
||||
widget: path.resolve('./app/javascript/widget'),
|
||||
survey: path.resolve('./app/javascript/survey'),
|
||||
assets: path.resolve('./app/javascript/dashboard/assets'),
|
||||
components: path.resolve('./app/javascript/dashboard/components'),
|
||||
helpers: path.resolve('./app/javascript/shared/helpers'),
|
||||
'./iconfont.eot': 'vue-easytable/libs/font/iconfont.eot',
|
||||
'./iconfont.woff': 'vue-easytable/libs/font/iconfont.woff',
|
||||
'./iconfont.ttf': 'vue-easytable/libs/font/iconfont.ttf',
|
||||
'./iconfont.svg': 'vue-easytable/libs/font/iconfont.svg',
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = resolve;
|
||||
@@ -1,5 +0,0 @@
|
||||
process.env.NODE_ENV = process.env.NODE_ENV || 'development'
|
||||
|
||||
const environment = require('./environment')
|
||||
|
||||
module.exports = environment.toWebpackConfig()
|
||||
@@ -1,119 +0,0 @@
|
||||
# Note: You must restart bin/webpack-dev-server for changes to take effect
|
||||
|
||||
default: &default
|
||||
source_path: app/javascript
|
||||
source_entry_path: packs
|
||||
public_root_path: public
|
||||
public_output_path: packs
|
||||
cache_path: tmp/cache/webpacker
|
||||
check_yarn_integrity: false
|
||||
webpack_compile_output: true
|
||||
|
||||
# Additional paths webpack should lookup modules
|
||||
# ['app/assets', 'engine/foo/app/assets']
|
||||
resolved_paths: []
|
||||
|
||||
# Reload manifest.json on all requests so we reload latest compiled packs
|
||||
cache_manifest: false
|
||||
|
||||
# Extract and emit a css file
|
||||
extract_css: false
|
||||
|
||||
static_assets_extensions:
|
||||
- .jpg
|
||||
- .jpeg
|
||||
- .png
|
||||
- .gif
|
||||
- .tiff
|
||||
- .ico
|
||||
- .svg
|
||||
- .eot
|
||||
- .otf
|
||||
- .ttf
|
||||
- .woff
|
||||
- .woff2
|
||||
|
||||
extensions:
|
||||
- .vue
|
||||
- .mjs
|
||||
- .js
|
||||
- .sass
|
||||
- .scss
|
||||
- .css
|
||||
- .module.sass
|
||||
- .module.scss
|
||||
- .module.css
|
||||
- .png
|
||||
- .svg
|
||||
- .gif
|
||||
- .jpeg
|
||||
- .jpg
|
||||
|
||||
development:
|
||||
<<: *default
|
||||
compile: true
|
||||
|
||||
# Verifies that correct packages and versions are installed by inspecting package.json, yarn.lock, and node_modules
|
||||
check_yarn_integrity: true
|
||||
|
||||
# Reference: https://webpack.js.org/configuration/dev-server/
|
||||
dev_server:
|
||||
https: false
|
||||
host: 0.0.0.0
|
||||
port: 3035
|
||||
public: 0.0.0.0:3035
|
||||
hmr: true
|
||||
# Inline should be set to true if using HMR
|
||||
inline: true
|
||||
overlay: true
|
||||
compress: true
|
||||
disable_host_check: true
|
||||
use_local_ip: false
|
||||
quiet: false
|
||||
headers:
|
||||
'Access-Control-Allow-Origin': '*'
|
||||
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, PATCH, OPTIONS'
|
||||
'Access-Control-Allow-Headers': 'X-Requested-With, content-type, Authorization'
|
||||
watch_options:
|
||||
ignored: '**/node_modules/**'
|
||||
|
||||
|
||||
test:
|
||||
<<: *default
|
||||
compile: true
|
||||
|
||||
# Compile test packs to a separate directory
|
||||
public_output_path: packs-test
|
||||
|
||||
dev_server:
|
||||
https: false
|
||||
host: 0.0.0.0
|
||||
port: 3035
|
||||
public: 0.0.0.0:3035
|
||||
hmr: true
|
||||
# Inline should be set to true if using HMR
|
||||
inline: true
|
||||
overlay: true
|
||||
compress: true
|
||||
disable_host_check: true
|
||||
use_local_ip: false
|
||||
quiet: false
|
||||
headers:
|
||||
'Access-Control-Allow-Origin': '*'
|
||||
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, PATCH, OPTIONS'
|
||||
'Access-Control-Allow-Headers': 'X-Requested-With, content-type, Authorization'
|
||||
watch_options:
|
||||
ignored: '**/node_modules/**'
|
||||
|
||||
|
||||
production:
|
||||
<<: *default
|
||||
|
||||
# Production depends on precompilation of packs prior to booting for performance.
|
||||
compile: false
|
||||
|
||||
# Extract and emit a css file
|
||||
extract_css: true
|
||||
|
||||
# Cache manifest.json for performance
|
||||
cache_manifest: true
|
||||
+2
-2
@@ -30,7 +30,7 @@ services:
|
||||
depends_on:
|
||||
- postgres
|
||||
- redis
|
||||
- webpack
|
||||
- vite
|
||||
- mailhog
|
||||
- sidekiq
|
||||
ports:
|
||||
@@ -80,7 +80,7 @@ services:
|
||||
- NODE_ENV=development
|
||||
- RAILS_ENV=development
|
||||
entrypoint: docker/entrypoints/webpack.sh
|
||||
command: bin/webpack-dev-server
|
||||
command: bin/vite
|
||||
|
||||
postgres:
|
||||
image: postgres:12
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
FROM chatwoot:development
|
||||
|
||||
RUN chmod +x docker/entrypoints/webpack.sh
|
||||
RUN chmod +x docker/entrypoints/vite.sh
|
||||
|
||||
EXPOSE 3035
|
||||
CMD ["bin/webpack-dev-server"]
|
||||
CMD ["bin/vite"]
|
||||
|
||||
@@ -15,6 +15,6 @@ do
|
||||
sleep 2;
|
||||
done
|
||||
|
||||
echo "Ready to run webpack development server."
|
||||
echo "Ready to run frontend development server."
|
||||
|
||||
exec "$@"
|
||||
+2
-22
@@ -9,12 +9,9 @@
|
||||
"test": "jest -w 1 --no-cache --no-coverage",
|
||||
"test:watch": "jest -w 1 --watch --no-cache",
|
||||
"test:coverage": "jest -w 1 --no-cache --collectCoverage",
|
||||
"webpacker-start": "webpack-dev-server -d --config webpack.dev.config.js --content-base public/ --progress --colors",
|
||||
"start:dev": "foreman start -f ./Procfile.dev",
|
||||
"start:test": "RAILS_ENV=test foreman start -f ./Procfile.test",
|
||||
"start:dev-overmind": "overmind start -f ./Procfile.dev",
|
||||
"storybook": "start-storybook -p 6006",
|
||||
"build-storybook": "build-storybook",
|
||||
"ruby:prettier": "bundle exec rubocop -a",
|
||||
"prepare": "husky install",
|
||||
"size": "size-limit"
|
||||
@@ -38,7 +35,6 @@
|
||||
"@radix-ui/colors": "^1.0.1",
|
||||
"@rails/actioncable": "6.1.3",
|
||||
"@rails/ujs": "^7.0.3-1",
|
||||
"@rails/webpacker": "5.4.4",
|
||||
"@scmmishra/pico-search": "0.5.1",
|
||||
"@sentry/tracing": "^6.19.7",
|
||||
"@sentry/vue": "^6.19.7",
|
||||
@@ -72,11 +68,9 @@
|
||||
"ninja-keys": "^1.2.2",
|
||||
"opus-recorder": "^8.0.5",
|
||||
"postcss": "^8.4.31",
|
||||
"postcss-loader": "^4.2.0",
|
||||
"semver": "7.5.3",
|
||||
"tailwindcss": "^3.3.2",
|
||||
"turbolinks": "^5.2.0",
|
||||
"url-loader": "^2.0.0",
|
||||
"urlpattern-polyfill": "^6.0.2",
|
||||
"v-tooltip": "~2.1.3",
|
||||
"videojs-record": "^4.5.0",
|
||||
@@ -88,7 +82,6 @@
|
||||
"vue-easytable": "2.5.5",
|
||||
"vue-i18n": "8.24.3",
|
||||
"vue-letter": "^0.1.3",
|
||||
"vue-loader": "^15.10.0",
|
||||
"vue-multiselect": "~2.1.6",
|
||||
"vue-router": "~3.5.2",
|
||||
"vue-template-compiler": "^2.7.0",
|
||||
@@ -98,9 +91,7 @@
|
||||
"vuedraggable": "^2.24.3",
|
||||
"vuex": "~2.1.1",
|
||||
"vuex-router-sync": "~4.1.2",
|
||||
"wavesurfer.js": "^6.0.4",
|
||||
"webpack": "^4.46.0",
|
||||
"webpack-cli": "^3.3.12"
|
||||
"wavesurfer.js": "^6.0.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.13.16",
|
||||
@@ -109,13 +100,6 @@
|
||||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
|
||||
"@babel/preset-env": "7.13.15",
|
||||
"@size-limit/file": "^8.2.4",
|
||||
"@storybook/addon-actions": "6.5.9",
|
||||
"@storybook/addon-docs": "^6.5.9",
|
||||
"@storybook/addon-essentials": "6.5.9",
|
||||
"@storybook/addon-links": "6.5.9",
|
||||
"@storybook/addon-postcss": "^2.0.0",
|
||||
"@storybook/addons": "6.5.9",
|
||||
"@storybook/vue": "6.5.9",
|
||||
"@types/jest": "^29.5.2",
|
||||
"@vitejs/plugin-vue2": "^2.3.1",
|
||||
"@vue/test-utils": "^1.3.6",
|
||||
@@ -123,20 +107,17 @@
|
||||
"babel-core": "^7.0.0-bridge.0",
|
||||
"babel-helper-vue-jsx-merge-props": "^2.0.3",
|
||||
"babel-jest": "29",
|
||||
"babel-loader": "8.2.2",
|
||||
"babel-preset-vue": "^2.0.2",
|
||||
"cypress": "^13.4.0",
|
||||
"eslint": "^8.49.0",
|
||||
"eslint-config-airbnb-base": "15.0.0",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-import-resolver-webpack": "^0.13.7",
|
||||
"eslint-plugin-babel": "5.3.1",
|
||||
"eslint-plugin-cypress": "^2.15.1",
|
||||
"eslint-plugin-html": "7.1.0",
|
||||
"eslint-plugin-import": "2.28.1",
|
||||
"eslint-plugin-jsx-a11y": "6.7.1",
|
||||
"eslint-plugin-prettier": "5.0.0",
|
||||
"eslint-plugin-storybook": "^0.6.14",
|
||||
"eslint-plugin-vue": "^9.17.0",
|
||||
"expect-more-jest": "^2.4.2",
|
||||
"fake-indexeddb": "^4.0.1",
|
||||
@@ -151,8 +132,7 @@
|
||||
"rimraf": "^3.0.0",
|
||||
"size-limit": "^8.2.4",
|
||||
"vite": "^5.0.0",
|
||||
"vite-plugin-ruby": "^5.0.0",
|
||||
"webpack-dev-server": "^3"
|
||||
"vite-plugin-ruby": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "20.x",
|
||||
|
||||
Reference in New Issue
Block a user