straw-hat-labs / phoenix_assets_webpack Goto Github PK
View Code? Open in Web Editor NEWAsset Pipeline with Webpack on Phoenix
License: MIT License
Asset Pipeline with Webpack on Phoenix
License: MIT License
I was looking for something like this for a long time and wanted to thank you for putting this up.
Exactly the toolchain and libraries I was looking for...
ERROR in ./src/css/app.scss
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ReferenceError: window is not defined
at /Users/krystof/git/startup_bullshit/assets/node_modules/style-loader/index.js!/Users/krystof/git/startup_bullshit/assets/node_modules/css-loader/index.js!/Users/krystof/git/startup_bullshit/assets/node_modules/postcss-loader/lib/index.js!/Users/krystof/git/startup_bullshit/assets/node_modules/sass-loader/lib/loader.js!/Users/krystof/git/startup_bullshit/assets/src/css/app.scss:255:2
at /Users/krystof/git/startup_bullshit/assets/node_modules/style-loader/index.js!/Users/krystof/git/startup_bullshit/assets/node_modules/css-loader/index.js!/Users/krystof/git/startup_bullshit/assets/node_modules/postcss-loader/lib/index.js!/Users/krystof/git/startup_bullshit/assets/node_modules/sass-loader/lib/loader.js!/Users/krystof/git/startup_bullshit/assets/src/css/app.scss:244:46
at module.exports../node_modules/style-loader/lib/addStyles.js.module.exports (/Users/krystof/git/startup_bullshit/assets/node_modules/style-loader/index.js!/Users/krystof/git/startup_bullshit/assets/node_modules/css-loader/index.js!/Users/krystof/git/startup_bullshit/assets/node_modules/postcss-loader/lib/index.js!/Users/krystof/git/startup_bullshit/assets/node_modules/sass-loader/lib/loader.js!/Users/krystof/git/startup_bullshit/assets/src/css/app.scss:309:88)
at Object../node_modules/style-loader/index.js!./node_modules/css-loader/index.js!./node_modules/postcss-loader/lib/index.js!./node_modules/sass-loader/lib/loader.js!./src/css/app.scss (/Users/krystof/git/startup_bullshit/assets/node_modules/style-loader/index.js!/Users/krystof/git/startup_bullshit/assets/node_modules/css-loader/index.js!/Users/krystof/git/startup_bullshit/assets/node_modules/postcss-loader/lib/index.js!/Users/krystof/git/startup_bullshit/assets/node_modules/sass-loader/lib/loader.js!/Users/krystof/git/startup_bullshit/assets/src/css/app.scss:218:137)
at __webpack_require__ (/Users/krystof/git/startup_bullshit/assets/node_modules/style-loader/index.js!/Users/krystof/git/startup_bullshit/assets/node_modules/css-loader/index.js!/Users/krystof/git/startup_bullshit/assets/node_modules/postcss-loader/lib/index.js!/Users/krystof/git/startup_bullshit/assets/node_modules/sass-loader/lib/loader.js!/Users/krystof/git/startup_bullshit/assets/src/css/app.scss:21:30)
at /Users/krystof/git/startup_bullshit/assets/node_modules/style-loader/index.js!/Users/krystof/git/startup_bullshit/assets/node_modules/css-loader/index.js!/Users/krystof/git/startup_bullshit/assets/node_modules/postcss-loader/lib/index.js!/Users/krystof/git/startup_bullshit/assets/node_modules/sass-loader/lib/loader.js!/Users/krystof/git/startup_bullshit/assets/src/css/app.scss:85:18
at Object.<anonymous> (/Users/krystof/git/startup_bullshit/assets/node_modules/style-loader/index.js!/Users/krystof/git/startup_bullshit/assets/node_modules/css-loader/index.js!/Users/krystof/git/startup_bullshit/assets/node_modules/postcss-loader/lib/index.js!/Users/krystof/git/startup_bullshit/assets/node_modules/sass-loader/lib/loader.js!/Users/krystof/git/startup_bullshit/assets/src/css/app.scss:88:10)
at Module._compile (/Users/krystof/git/startup_bullshit/assets/node_modules/v8-compile-cache/v8-compile-cache.js:178:30)
Issue is decribed in:
webpack-contrib/extract-text-webpack-plugin#503
You need to remove style-loader
:
clean-webpack-plugin: /Users/krystof/git/startup_bullshit/priv/static has been removed.
diff --git a/webpack/webpack.common.js b/webpack/webpack.common.js
index 0e9dbd2..961b9a5 100644
--- a/webpack/webpack.common.js
+++ b/webpack/webpack.common.js
@@ -52,19 +52,15 @@ module.exports = {
},
{
test: /\.(css)$/,
- use: [
- MiniCssExtractPlugin.loader,
- "css-loader"
- ]
+ use: [MiniCssExtractPlugin.loader, "css-loader"]
},
{
test: /\.s?[ac]ss$/,
use: [
MiniCssExtractPlugin.loader,
- "style-loader",
"css-loader",
"postcss-loader",
- "sass-loader",
+ "sass-loader"
]
},
{
Tried assets/src/Hello.elm
- doesn't get picked up.
Thanks!
Dependabot couldn't fetch one or more of your project's path-based JavaScript dependencies. The affected dependencies were phoenix
and phoenix_html
.
To use path-based dependancies with Dependabot the paths must be relative and resolve to a directory in this project's source code.
You can mention @dependabot in the comments below to contact the Dependabot team.
Any idea how I would approach this? Best practice?
Or do you replace both values every time you deploy your app?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.