Commit 6ea847cb authored by Linshizhi's avatar Linshizhi

backup

parent 09e3099b
......@@ -2,14 +2,12 @@
// Generated on Tue Apr 19 2022 21:54:47 GMT+0800 (China Standard Time)
const path = require('path');
const os = require('os');
const webpack_path = path.resolve(__dirname, 'dist');
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '/home/linshizhi/Codebase/ParaEncode',
basePath: '',
// frameworks to use
// available frameworks: https://www.npmjs.com/search?q=keywords:karma-adapter
......@@ -18,10 +16,8 @@ module.exports = function(config) {
// list of files / patterns to load in the browser
files: [
{ pattern: webpack_path + '/*.js', included: true, served: true },
{ pattern: 'src/**/*.js', included: true },
{ pattern: 'tests/**/*.spec.js', included: true },
{ pattern: 'tests/**/*.js', included: true }
{ pattern: 'tmp/spec_bundle.js', included: true },
{ pattern: 'src/**/*.js', included: false, served: true },
],
// list of files / patterns to exclude
......@@ -35,18 +31,14 @@ module.exports = function(config) {
// preprocess matching files before serving them to the browser
// available preprocessors: https://www.npmjs.com/search?q=keywords:karma-preprocessor
preprocessors: {
"resources/**/*.js": ["webpack"],
"src/**/*.js": ["webpack"],
"tests/**/*.spec.js": ["webpack"],
"tests/**/*.js": ["webpack"]
},
preprocessors: {},
webpack: {
entry: './specs.js',
mode: 'development',
output: {
filename: '[name].js',
path: webpack_path,
filename: 'spec_bundle.js',
path: path.resolve(__dirname, 'tmp'),
},
},
......
const testsContext = require.context('./tests', true, /.spec.js$/);
testsContext.keys().forEach(testsContext);
const path = require('path');
const webpack = require("webpack");
module.exports = {
entry: './index.js',
entry: './specs.js',
mode: 'development',
output: {
publicPath: 'dist/',
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
filename: 'spec_bundle.js',
path: path.resolve(__dirname, 'tmp'),
},
mode: 'development',
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
}
]
},
plugins: [
new webpack.ProvidePlugin({
process: 'process/browser',
})
]
};
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