You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is this possible with the current state the project is in? I don't know Webpack at all, so maybe all I have to do is transfer the files I need to the /build folder somehow?
EDIT: Previously used File Manager Webpack plugin but this can be easily done with the currently used Copy Webpack Plugin.
newCopyWebpackPlugin([{from: 'src/manifest.json',transform: function(content,path){// generates the manifest file using the package.json informationsreturnBuffer.from(JSON.stringify({description: process.env.npm_package_description,version: process.env.npm_package_version,
...JSON.parse(content.toString())}));}},{from: path.join(__dirname,'src','injected','script.js'),}]),
However it would be great if this was automatically generated from the "web_accessible_resources" option in manifest.json. Additionally, I don't know how you'd apply Babel etc. to these files? Or something like SASS.
Moreover, hot reload on these files doesn't work.
The text was updated successfully, but these errors were encountered:
\\webpack.config.jsvarMiniCssExtractPlugin=require('mini-css-extract-plugin');options.plugins: [newMiniCssExtractPlugin({// Options similar to the same options in webpackOptions.output// both options are optionalfilename: '[name].css',chunkFilename: '[id].css'}),]
Make popup.scss and options.scss compile as normal, but make the web_accessible_file be compiled by MiniCssExtractPlugin to a separate file.
\\webpack.config.jsoptions.module.rules: [{test: /\.(s*)css$/,use: ['style-loader','css-loader','sass-loader'],exclude: /node_modules/},{// where globalStyles.css is the file you have declared in web_accessible_resources!test: /globalStyles\.scss$/,use: [{loader: MiniCssExtractPlugin.loader,options: {// you can specify a publicPath here// by default it use publicPath in webpackOptions.outputpublicPath: 'dist/'}},'css-loader','sass-loader']},]
EDIT: Problem is there is an unnecessary 'globalStyles.bundle.js' file generated.
I've done this sucessfully in my chrome extension project before changing it as per the boilerplate.
I have a CSS file and a JS file declared in the "web_accessible_resources" option.
This is how I inject it inside of a content script:
Is this possible with the current state the project is in? I don't know Webpack at all, so maybe all I have to do is transfer the files I need to the /build folder somehow?
EDIT: Previously used File Manager Webpack plugin but this can be easily done with the currently used Copy Webpack Plugin.
However it would be great if this was automatically generated from the "web_accessible_resources" option in manifest.json. Additionally, I don't know how you'd apply Babel etc. to these files? Or something like SASS.
Moreover, hot reload on these files doesn't work.
The text was updated successfully, but these errors were encountered: